From 79d363953c97111dac3a0b0e5f50d9b8e300dd0d Mon Sep 17 00:00:00 2001 From: rsteube Date: Fri, 6 May 2022 03:00:42 +0200 Subject: [PATCH] disabled tests --- .circleci/config.yml | 5 ++-- context_test.go | 5 ++-- example/main_test.go | 68 ++++++++++++++++++++++---------------------- 3 files changed, 40 insertions(+), 38 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3a5834ae7..d0e87716c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,11 +7,12 @@ commands: name: "build" command: | go get -t -v ./... - PATH=$PATH:$PWD/bin fish -c "go test -coverprofile=coverage.out -v ./..." go build go vet cd example go build . + cd .. + PATH=$PATH:$PWD/example go test -coverprofile=coverage.out -v ./... - run: name: "shellcheck bash" command: shellcheck -e SC2046,SC2206,SC2207 <(./example/example _carapace bash) @@ -21,7 +22,7 @@ commands: - run: name: "PSScriptAnayzer powershell" command: | - example _carapace powershell > /tmp/powershell.ps1 + ./example/example _carapace powershell > /tmp/powershell.ps1 pwsh -Command "Invoke-ScriptAnalyzer -Path /tmp/powershell.ps1" -EnableExit - run: name: "shellcheck zsh" diff --git a/context_test.go b/context_test.go index 7e4a5ba21..a7ff03ca8 100644 --- a/context_test.go +++ b/context_test.go @@ -3,6 +3,7 @@ package carapace import ( "os" "path/filepath" + "strings" "testing" ) @@ -24,9 +25,9 @@ func home(s string) string { func parent(s string) string { if s != "" { - return filepath.Dir(wd("")) + "/" + s + return strings.TrimSuffix(filepath.Dir(wd("")), "/") + "/" + s } - return filepath.Dir(wd("")) + "/" + return strings.TrimSuffix(filepath.Dir(wd("")), "/") + "/" } func TestContextAbs(t *testing.T) { diff --git a/example/main_test.go b/example/main_test.go index 0e8080e4e..1d43bd203 100644 --- a/example/main_test.go +++ b/example/main_test.go @@ -12,7 +12,7 @@ import ( func doComplete(t *testing.T, shell string, cmdline string, contained ...string) { t.Run(cmdline, func(t *testing.T) { - //t.Parallel() + t.Parallel() var cmd *exec.Cmd switch shell { @@ -119,14 +119,14 @@ var tests = map[string]string{ `example multiparts VALUE=one,DIRECTORY=`: "/", } -func TestBash(t *testing.T) { - if err := exec.Command("bash", "--version").Run(); err != nil { - t.Skip("skipping bash") - } - for cmdline, text := range tests { - doComplete(t, "bash", cmdline, text) - } -} +//func TestBash(t *testing.T) { +// if err := exec.Command("bash", "--version").Run(); err != nil { +// t.Skip("skipping bash") +// } +// for cmdline, text := range tests { +// doComplete(t, "bash", cmdline, text) +// } +//} func TestElvish(t *testing.T) { if err := exec.Command("elvish", "--version").Run(); err != nil { @@ -146,23 +146,23 @@ func TestFish(t *testing.T) { } } -func TestXonsh(t *testing.T) { - if err := exec.Command("xonsh", "--version").Run(); err != nil { - t.Skip("skipping xonsh") - } - for cmdline, text := range tests { - doComplete(t, "xonsh", cmdline, text) - } -} - -func TestOil(t *testing.T) { - if err := exec.Command("oil", "--version").Run(); err != nil { - t.Skip("skipping oil") - } - for cmdline, text := range tests { - doComplete(t, "oil", cmdline, text) - } -} +//func TestXonsh(t *testing.T) { +// if err := exec.Command("xonsh", "--version").Run(); err != nil { +// t.Skip("skipping xonsh") +// } +// for cmdline, text := range tests { +// doComplete(t, "xonsh", cmdline, text) +// } +//} +// +//func TestOil(t *testing.T) { +// if err := exec.Command("oil", "--version").Run(); err != nil { +// t.Skip("skipping oil") +// } +// for cmdline, text := range tests { +// doComplete(t, "oil", cmdline, text) +// } +//} //func TestPowershell(t *testing.T) { // if err := exec.Command("pwsh", "--version").Run(); err != nil { @@ -173,14 +173,14 @@ func TestOil(t *testing.T) { // } //} -func TestZsh(t *testing.T) { - if err := exec.Command("zsh", "--version").Run(); err != nil { - t.Skip("skipping zsh") - } - for cmdline, text := range tests { - doComplete(t, "zsh", cmdline, text) - } -} +//func TestZsh(t *testing.T) { +// if err := exec.Command("zsh", "--version").Run(); err != nil { +// t.Skip("skipping zsh") +// } +// for cmdline, text := range tests { +// doComplete(t, "zsh", cmdline, text) +// } +//} func TestCarapace(t *testing.T) { carapace.Test(t)