blob: d5e1c1dffbf1bcd4c528920d5e0ccbb71043f442 [file] [log] [blame]
package repo
import "testing"
func TestCacheCreateKey(t *testing.T) {
tests := map[string]string{
"https://github.com/foo/bar": "https-github.com-foo-bar",
"git@github.com:foo/bar": "git-github.com-foo-bar",
}
for k, v := range tests {
key, err := cacheCreateKey(k)
if err != nil {
t.Errorf("Cache key generation err: %s", err)
continue
}
if key != v {
t.Errorf("Expected cache key %s for %s but got %s", v, k, key)
}
}
}