Fix the dependency issue (#231)

This commit is contained in:
Robbie Zhang
2018-06-21 12:09:42 -07:00
committed by GitHub
parent 027b76651d
commit 6ec1098bb8
16629 changed files with 74837 additions and 4975021 deletions

View File

@@ -1,55 +0,0 @@
package urlutil
import "testing"
var (
gitUrls = []string{
"git://github.com/hyperhq/hypercli",
"git@github.com:docker/docker.git",
"git@bitbucket.org:atlassianlabs/atlassian-docker.git",
"https://github.com/hyperhq/hypercli.git",
"http://github.com/hyperhq/hypercli.git",
"http://github.com/hyperhq/hypercli.git#branch",
"http://github.com/hyperhq/hypercli.git#:dir",
}
incompleteGitUrls = []string{
"github.com/hyperhq/hypercli",
}
invalidGitUrls = []string{
"http://github.com/hyperhq/hypercli.git:#branch",
}
)
func TestValidGitTransport(t *testing.T) {
for _, url := range gitUrls {
if IsGitTransport(url) == false {
t.Fatalf("%q should be detected as valid Git prefix", url)
}
}
for _, url := range incompleteGitUrls {
if IsGitTransport(url) == true {
t.Fatalf("%q should not be detected as valid Git prefix", url)
}
}
}
func TestIsGIT(t *testing.T) {
for _, url := range gitUrls {
if IsGitURL(url) == false {
t.Fatalf("%q should be detected as valid Git url", url)
}
}
for _, url := range incompleteGitUrls {
if IsGitURL(url) == false {
t.Fatalf("%q should be detected as valid Git url", url)
}
}
for _, url := range invalidGitUrls {
if IsGitURL(url) == true {
t.Fatalf("%q should not be detected as valid Git prefix", url)
}
}
}