Skip to content
quarry Artifact [36137652f7]
Login

Artifact [36137652f7]

Artifact 36137652f705417df856d424f401e18a6cb22c2a0bc8be395f5d5ce1a5f481ba:


package api

import "testing"

func TestAMirrorRemoteBecomesItsWebAddress(t *testing.T) {
	for remote, want := range map[string]string{
		"[email protected]:owner/repo.git":          "github.com owner/repo",
		"ssh://[email protected]/owner/repo.git":    "github.com owner/repo",
		"ssh://[email protected]:2222/g/sub/r":    "host.example g/sub/r",
		"[email protected]:group/sub/repo":  "gitlab.example.org group/sub/repo",
		"ssh://[email protected]:2222/~/repo.git": " ",
	} {
		h, p := gitRemoteHostPath(remote)
		if got := h + " " + p; got != want {
			t.Errorf("FAIL: %q -> %q, want %q", remote, got, want)
		}
	}
}