monwork - add more tests to the fields function

This commit is contained in:
Gibheer 2018-12-14 14:04:48 +01:00
parent 10fb89a017
commit 17457f0e53
1 changed files with 4 additions and 1 deletions

View File

@ -17,7 +17,10 @@ func TestStringToShellFields(t *testing.T) {
S{`foo "bar"`, []string{"foo", `bar`}},
S{`foo "bar baz"`, []string{"foo", `bar baz`}},
S{`foo "bar" "baz"`, []string{"foo", `bar`, `baz`}},
S{`foo "bar" "baz"`, []string{"foo", `bar`, `baz`}},
S{`foo "bar" baz`, []string{"foo", `bar`, `baz`}},
S{`foo "bar 'hello" baz`, []string{"foo", `bar 'hello`, `baz`}},
S{`foo "bar hello'" baz`, []string{"foo", `bar hello'`, `baz`}},
S{`foo "bar 'hello'" baz`, []string{"foo", `bar 'hello'`, `baz`}},
} {
result := stringToShellFields([]byte(e.source))
if err := compare(e.target, result); err != nil {