mirror of
https://github.com/spf13/cobra
synced 2024-11-25 07:07:15 +00:00
Fixed tests for how they are run
This commit is contained in:
parent
1057f75af9
commit
e97dbc5a21
1 changed files with 3 additions and 5 deletions
|
@ -29,11 +29,9 @@ func reset() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestProjectPath(t *testing.T) {
|
func TestProjectPath(t *testing.T) {
|
||||||
wd, _ := os.Getwd()
|
checkGuess(t, "", filepath.Join("github.com", "spf13", "hugo"), filepath.Join(getSrcPath(), "github.com", "spf13", "hugo"))
|
||||||
|
checkGuess(t, "", filepath.Join("spf13", "hugo"), filepath.Join(getSrcPath(), "github.com", "spf13", "hugo"))
|
||||||
checkGuess(t, "", "github.com/spf13/hugo", filepath.Join(wd, "github.com", "spf13", "hugo"))
|
checkGuess(t, "", filepath.Join("/", "bar", "foo"), filepath.Join(getSrcPath(), "bar", "foo"))
|
||||||
checkGuess(t, "", "spf13/hugo", filepath.Join(wd, "spf13", "hugo"))
|
|
||||||
checkGuess(t, "", "/bar/foo", filepath.Join(wd, "bar", "foo"))
|
|
||||||
checkGuess(t, "/bar/foo", "baz", filepath.Join("/", "bar", "foo", "baz"))
|
checkGuess(t, "/bar/foo", "baz", filepath.Join("/", "bar", "foo", "baz"))
|
||||||
checkGuess(t, "/bar/foo/cmd", "", filepath.Join("/", "bar", "foo"))
|
checkGuess(t, "/bar/foo/cmd", "", filepath.Join("/", "bar", "foo"))
|
||||||
checkGuess(t, "/bar/foo/command", "", filepath.Join("/", "bar", "foo"))
|
checkGuess(t, "/bar/foo/command", "", filepath.Join("/", "bar", "foo"))
|
||||||
|
|
Loading…
Reference in a new issue