blob: 6104434d70eed33577d33b8690a51cc8a26d68b5 [file] [log] [blame]
package cmd
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)
}
}
}