Skip to content

Commit

Permalink
fix unix tests under windows
Browse files Browse the repository at this point in the history
  • Loading branch information
creativeprojects committed Nov 13, 2024
1 parent 0879084 commit 240601a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions shell/split_arguments_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ func TestSplitArguments(t *testing.T) {
commandLine string
expectedArgs []string
windowsMode bool
unixMode bool
}{
{
commandLine: `cmd arg1 arg2`,
Expand Down Expand Up @@ -44,10 +45,12 @@ func TestSplitArguments(t *testing.T) {
{
commandLine: `cmd "arg \"with\" spaces"`,
expectedArgs: []string{"cmd", "arg \"with\" spaces"},
unixMode: true,
},
{
commandLine: `cmd arg\ with\ spaces`,
expectedArgs: []string{"cmd", "arg with spaces"},
unixMode: true,
},
{
commandLine: `args --with folder/file.txt`,
Expand All @@ -64,6 +67,9 @@ func TestSplitArguments(t *testing.T) {
if testCase.windowsMode && !platform.IsWindows() {
continue
}
if testCase.unixMode && platform.IsWindows() {
continue
}
t.Run(testCase.commandLine, func(t *testing.T) {
args := SplitArguments(testCase.commandLine)
assert.Equal(t, testCase.expectedArgs, args)
Expand Down

0 comments on commit 240601a

Please sign in to comment.