|
@@ -97,43 +97,3 @@ func TestReadSymlinkedDirectoryToFile(t *testing.T) {
|
|
|
t.Errorf("failed to remove symlink: %s", err)
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-var (
|
|
|
- gitUrls = []string{
|
|
|
- "git://github.com/docker/docker",
|
|
|
- "git@github.com:docker/docker.git",
|
|
|
- "git@bitbucket.org:atlassianlabs/atlassian-docker.git",
|
|
|
- "https://github.com/docker/docker.git",
|
|
|
- "http://github.com/docker/docker.git",
|
|
|
- }
|
|
|
- incompleteGitUrls = []string{
|
|
|
- "github.com/docker/docker",
|
|
|
- }
|
|
|
-)
|
|
|
-
|
|
|
-func TestValidGitTransport(t *testing.T) {
|
|
|
- for _, url := range gitUrls {
|
|
|
- if ValidGitTransport(url) == false {
|
|
|
- t.Fatalf("%q should be detected as valid Git prefix", url)
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- for _, url := range incompleteGitUrls {
|
|
|
- if ValidGitTransport(url) == true {
|
|
|
- t.Fatalf("%q should not be detected as valid Git prefix", url)
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-func TestIsGIT(t *testing.T) {
|
|
|
- for _, url := range gitUrls {
|
|
|
- if IsGIT(url) == false {
|
|
|
- t.Fatalf("%q should be detected as valid Git url", url)
|
|
|
- }
|
|
|
- }
|
|
|
- for _, url := range incompleteGitUrls {
|
|
|
- if IsGIT(url) == false {
|
|
|
- t.Fatalf("%q should be detected as valid Git url", url)
|
|
|
- }
|
|
|
- }
|
|
|
-}
|