Skip to content

Commit b84dd65

Browse files
Update pkg/limayaml/limayaml_test.go
Co-authored-by: Oleksandr Redko <[email protected]> Signed-off-by: Anders F Björklund <[email protected]>
1 parent 1a101d2 commit b84dd65

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pkg/limayaml/limayaml_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ import (
88
"gotest.tools/v3/assert"
99
)
1010

11-
func dumpJSON(d interface{}) string {
11+
func dumpJSON(t *testing.T, d interface{}) string {
1212
b, err := json.Marshal(d)
1313
if err != nil {
14-
return "ERROR"
14+
t.Fatal(err)
1515
}
1616
return string(b)
1717
}
@@ -20,7 +20,7 @@ const emptyYAML = "images: []\n"
2020

2121
func TestEmptyYAML(t *testing.T) {
2222
var y LimaYAML
23-
t.Log(dumpJSON(y))
23+
t.Log(dumpJSON(t, y))
2424
b, err := marshalYAML(y)
2525
assert.NilError(t, err)
2626
assert.Equal(t, string(b), emptyYAML)
@@ -36,7 +36,7 @@ func TestDefaultYAML(t *testing.T) {
3636
assert.NilError(t, err)
3737
y.Images = nil // remove default images
3838
y.Mounts = nil // remove default mounts
39-
t.Log(dumpJSON(y))
39+
t.Log(dumpJSON(t, y))
4040
b, err := marshalYAML(y)
4141
assert.NilError(t, err)
4242
assert.Equal(t, string(b), defaultYAML)

0 commit comments

Comments
 (0)