From 794d271152906edd1629cce296ebd9bc969d321f Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Wed, 21 Oct 2015 14:11:30 -0600 Subject: [PATCH] Remove extra tests that were Linux-specific These tests with the backslash seem to assert that shlex (our Unix shell parsing library) is working properly, not our wrapper function (that parses commands for both Windows and non-Windows). These tests break on Windows so I have removed them. --- middleware/commands_test.go | 29 ++++------------------------- 1 file changed, 4 insertions(+), 25 deletions(-) diff --git a/middleware/commands_test.go b/middleware/commands_test.go index 83b7678d..770bdd7d 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: "",