diff --git a/middleware/commands_test.go b/middleware/commands_test.go index 83b7678d5..770bdd7df 100644 --- a/middleware/commands_test.go +++ b/middleware/commands_test.go @@ -118,49 +118,28 @@ func TestSplitCommandAndArgs(t *testing.T) { expectedArgs: []string{`arg1 arg1`}, expectedErrContent: ``, }, - // Test case 4 - command with single argument with space character - escaped - { - input: `command arg1\ arg1`, - expectedCommand: `command`, - expectedArgs: []string{`arg1 arg1`}, - expectedErrContent: ``, - }, - // Test case 6 - command with escaped quote character - { - input: `command "arg1 \" arg1"`, - expectedCommand: `command`, - expectedArgs: []string{`arg1 " arg1`}, - expectedErrContent: ``, - }, - // Test case 7 - command with escaped backslash - { - input: `command '\arg1'`, - expectedCommand: `command`, - expectedArgs: []string{`\arg1`}, - expectedErrContent: ``, - }, - // Test case 8 - command with comments + // Test case 5 - command with comments { input: `command arg1 #comment1 comment2`, expectedCommand: `command`, expectedArgs: []string{`arg1`}, expectedErrContent: "", }, - // Test case 9 - command with multiple spaces and tab character + // Test case 6 - command with multiple spaces and tab character { input: "command arg1 arg2\targ3", expectedCommand: `command`, expectedArgs: []string{`arg1`, `arg2`, "arg3"}, expectedErrContent: "", }, - // Test case 10 - command with unclosed quotes + // Test case 7 - command with unclosed quotes { input: `command "arg1 arg2`, expectedCommand: "", expectedArgs: nil, expectedErrContent: parseErrorContent, }, - // Test case 11 - command with unclosed quotes + // Test case 8 - command with unclosed quotes { input: `command 'arg1 arg2"`, expectedCommand: "",