Support updating values in empty documents
This commit is contained in:
@@ -31,6 +31,14 @@ func TestUpdateYamlValue(t *testing.T) {
|
||||
expectedOut: "foo: bar\nfoo2: baz\n",
|
||||
expectedErr: "",
|
||||
},
|
||||
{
|
||||
name: "add new key and value when document was empty",
|
||||
in: "",
|
||||
path: []string{"foo"},
|
||||
value: "bar",
|
||||
expectedOut: "foo: bar\n",
|
||||
expectedErr: "",
|
||||
},
|
||||
{
|
||||
name: "preserve inline comment",
|
||||
in: "foo: bar # my comment\n",
|
||||
|
||||
Reference in New Issue
Block a user