package repo import "testing" func TestUnify(t *testing.T) { for url, expected := range map[string]string{ "https://git.intern/shop/api.git": "git.intern/shop/api", "https://user:geheim@Git.Intern/shop/api": "git.intern/shop/api", "git@git.intern:shop/api.git": "git.intern/shop/api", "ssh://git@git.intern:2222/shop/api.git": "git.intern/shop/api", "https://git.intern:8443/shop/api/": "git.intern:8443/shop/api", } { if got := Unify(url); got != expected { t.Errorf("Vereinheitlichen(%q) = %q, erwartet %q", url, got, expected) } } }