Skip to content

Commit

Permalink
Adjust to latest changes in go-yaml/yaml#684.
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfontein committed Feb 4, 2021
1 parent 9d04632 commit e4f8b87
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions stores/yaml/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ prometheus-node-exporter:
`)

var COMMENT_4 = []byte(`# foo
`)

var COMMENT_5 = []byte(`# foo
---
key: value
`)

func TestUnmarshalMetadataFromNonSOPSFile(t *testing.T) {
Expand Down Expand Up @@ -139,6 +143,16 @@ func TestComment4(t *testing.T) {
assert.Equal(t, COMMENT_4, bytes)
}

func TestComment5(t *testing.T) {
// First iteration: load and store
branches, err := (&Store{}).LoadPlainFile(COMMENT_5)
assert.Nil(t, err)
bytes, err := (&Store{}).EmitPlainFile(branches)
assert.Nil(t, err)
assert.Equal(t, string(COMMENT_5), string(bytes))
assert.Equal(t, COMMENT_5, bytes)
}

func TestEmpty(t *testing.T) {
// First iteration: load and store
branches, err := (&Store{}).LoadPlainFile([]byte(``))
Expand Down

0 comments on commit e4f8b87

Please sign in to comment.