This repository was archived by the owner on Dec 18, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use TrimSuffix instead of TrimRight to extract the repository path from
the path of the git folder
- Loading branch information
Ekans
committed
Apr 16, 2016
1 parent
98290e5
commit b1d2085
Showing
2 changed files
with
28 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package core | ||
|
||
import ( | ||
"reflect" | ||
"testing" | ||
) | ||
|
||
func TestCheckGitRepos(t *testing.T) { | ||
cases := []testReposAreValid{ | ||
{[]string{"repo1"}, []string{"repo1"}}, | ||
{[]string{"bash-git-prompt"}, []string{"bash-git-prompt"}}, | ||
} | ||
for _, data := range cases { | ||
result, err := CheckGitRepos(data.repos, nil) | ||
if err != nil { | ||
t.Errorf("Failed to check Git repos (%q) == %q, expected %q", data.repos, result, data.result) | ||
} | ||
if !reflect.DeepEqual(result, data.result) { | ||
t.Errorf("Failed to check Git repos (%q) == %q, expected %q", data.repos, result, data.result) | ||
} | ||
} | ||
} | ||
|
||
type testReposAreValid struct { | ||
repos []string | ||
result []string | ||
} |