diff options
author | Sascha Andres <sascha.andres@outlook.com> | 2018-09-10 06:51:19 +0200 |
---|---|---|
committer | Sascha Andres <sascha.andres@outlook.com> | 2018-09-10 06:51:19 +0200 |
commit | ba0cc20e228df324530f3ac6075a591dbae35bb9 (patch) | |
tree | ba9893b444ac37c0ab2ceaa060a775e00a1c30c3 /pkg/commands/os_test.go | |
parent | 717913e64c36fa5f468ac32c619afd6e3643a532 (diff) |
feat: add test cases
Diffstat (limited to 'pkg/commands/os_test.go')
-rw-r--r-- | pkg/commands/os_test.go | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/pkg/commands/os_test.go b/pkg/commands/os_test.go index 01173fb15..456c54e04 100644 --- a/pkg/commands/os_test.go +++ b/pkg/commands/os_test.go @@ -265,6 +265,30 @@ func TestOSCommandQuote(t *testing.T) { assert.EqualValues(t, expected, actual) } +func TestOSCommandQuoteSingleQuote(t *testing.T) { + osCommand := newDummyOSCommand() + + osCommand.Platform.os = "linux" + + actual := osCommand.Quote("hello 'test'") + + expected := osCommand.Platform.escapedQuote + "hello 'test'" + osCommand.Platform.escapedQuote + + assert.EqualValues(t, expected, actual) +} + +func TestOSCommandQuoteDoubleQuote(t *testing.T) { + osCommand := newDummyOSCommand() + + osCommand.Platform.os = "linux" + + actual := osCommand.Quote(`hello "test"`) + + expected := osCommand.Platform.escapedQuote + "hello \"test\"" + osCommand.Platform.escapedQuote + + assert.EqualValues(t, expected, actual) +} + func TestOSCommandUnquote(t *testing.T) { osCommand := newDummyOSCommand() |