Skip to content

Commit

Permalink
Merge pull request #5230 from thaJeztah/clean_skip
Browse files Browse the repository at this point in the history
cli/command/container: TestSplitCpArg: cleaner skip
  • Loading branch information
vvoland authored Jul 5, 2024
2 parents 5aae44b + 88896ee commit be6a415
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions cli/command/container/cp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
"gotest.tools/v3/assert"
is "gotest.tools/v3/assert/cmp"
"gotest.tools/v3/fs"
"gotest.tools/v3/skip"
)

func TestRunCopyWithInvalidArguments(t *testing.T) {
Expand Down Expand Up @@ -151,7 +150,7 @@ func TestSplitCpArg(t *testing.T) {
}{
{
doc: "absolute path with colon",
os: "linux",
os: "unix",
path: "/abs/path:withcolon",
expectedPath: "/abs/path:withcolon",
},
Expand Down Expand Up @@ -181,7 +180,12 @@ func TestSplitCpArg(t *testing.T) {
for _, tc := range testcases {
tc := tc
t.Run(tc.doc, func(t *testing.T) {
skip.If(t, tc.os == "windows" && runtime.GOOS != "windows" || tc.os == "linux" && runtime.GOOS == "windows")
if tc.os == "windows" && runtime.GOOS != "windows" {
t.Skip("skipping windows test on non-windows platform")
}
if tc.os == "unix" && runtime.GOOS == "windows" {
t.Skip("skipping unix test on windows")
}

ctr, path := splitCpArg(tc.path)
assert.Check(t, is.Equal(tc.expectedContainer, ctr))
Expand Down

0 comments on commit be6a415

Please sign in to comment.