Fixed delete command for arrays

This commit is contained in:
Mike Farah
2018-06-15 09:03:42 +10:00
parent 297522cbdd
commit 1b22e1d812
2 changed files with 12 additions and 10 deletions
+8
View File
@@ -106,3 +106,11 @@ func TestDeleteYaml(t *testing.T) {
"[{a Easy! as one two three} {b [{d [3 4]} {e [[{name fred} {value 3}] [{name sam} {value 4}]]}]}]",
formattedResult)
}
func TestDeleteYamlArray(t *testing.T) {
result, _ := deleteYaml([]string{"examples/sample_array.yaml", "[1]"})
formattedResult := fmt.Sprintf("%v", result)
assertResult(t,
"[1 3]",
formattedResult)
}