Something went wrong. Try again.
Maps Linux distribution source packages to their upstream repositories, and through them to each other
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253package opensuse
import ( "context" "testing")
func TestParseGitURLs(t *testing.T) { m := ParseGitURLs(`2048-cli/2048-cli.spec = https://github.com/tiehuis/2048-cli.gitxine-lib/xine-lib.spec = hg::https://hg.code.sf.net/p/xine/xine-lib-1.2akonadi/akonadi.spec = unknowndebug: albert/albert.spec only had https://albertlauncher.github.io/alac/alac.spec = https://github.com/macosforge/FIXME.git alacmulti/a.spec = https://github.com/o/a.gitmulti/b.spec = https://github.com/o/b.gitmulti/c.spec = https://github.com/o/a.git`) if len(m) != 3 { t.Fatalf("entries: %v", m) } if got := m["2048-cli"]; len(got) != 1 || got[0] != "https://github.com/tiehuis/2048-cli.git" { t.Errorf("2048-cli: %v", got) } if got := m["xine-lib"]; len(got) != 1 || got[0] != "hg::https://hg.code.sf.net/p/xine/xine-lib-1.2" { t.Errorf("xine-lib: %v", got) } if got := m["multi"]; len(got) != 2 { t.Errorf("multi: %v", got) } if _, ok := m["akonadi"]; ok { t.Error("unknown kept") } if _, ok := m["alac"]; ok { t.Error("FIXME kept") }}
func TestLoadGitURLs(t *testing.T) { r := newTestResolver(t) m, err := r.loadGitURLs(context.Background()) if err != nil { t.Fatal(err) } if len(m) != 3 || m["helm"][0] != "https://github.com/helm/helm.git" || m["ceph"][0] != "https://github.com/ceph/ceph.git" { t.Errorf("giturls: %v", m) } // Cached per base URL: a second call must not refetch (same map instance). m2, _ := r.loadGitURLs(context.Background()) if &m2 == nil || len(m2) != len(m) { t.Errorf("cache") }}