Fix quote strip behavior for ARG values

* fixes issue 847
* previous implementation did not properly parse blank
values which were enclosed in quotes
This commit is contained in:
Cole Wippern
2019-11-08 14:28:31 -08:00
parent 1d5e294f27
commit 006b4996cb
3 changed files with 64 additions and 14 deletions
+9 -1
View File
@@ -118,7 +118,7 @@ func Test_stripEnclosingQuotes(t *testing.T) {
success: true,
}, {
name: "blank value with enclosing double quotes",
inArgs: []instructions.ArgCommand{newArgCommand("MEOW", "\"\"")},
inArgs: []instructions.ArgCommand{newArgCommand("MEOW", `""`)},
expected: []string{""},
success: true,
}, {
@@ -144,6 +144,14 @@ func Test_stripEnclosingQuotes(t *testing.T) {
},
expected: []string{"Purr", "Mrow"},
success: true,
}, {
name: "multiple values, one blank, one a single int",
inArgs: []instructions.ArgCommand{
newArgCommand("MEOW", `""`),
newArgCommand("MEW", `1`),
},
expected: []string{"", "1"},
success: true,
}, {
name: "no values",
success: true,