File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -8,10 +8,10 @@ import (
8
8
"gotest.tools/v3/assert"
9
9
)
10
10
11
- func dumpJSON (d interface {}) string {
11
+ func dumpJSON (t * testing. T , d interface {}) string {
12
12
b , err := json .Marshal (d )
13
13
if err != nil {
14
- return "ERROR"
14
+ t . Fatal ( err )
15
15
}
16
16
return string (b )
17
17
}
@@ -20,7 +20,7 @@ const emptyYAML = "images: []\n"
20
20
21
21
func TestEmptyYAML (t * testing.T ) {
22
22
var y LimaYAML
23
- t .Log (dumpJSON (y ))
23
+ t .Log (dumpJSON (t , y ))
24
24
b , err := marshalYAML (y )
25
25
assert .NilError (t , err )
26
26
assert .Equal (t , string (b ), emptyYAML )
@@ -36,7 +36,7 @@ func TestDefaultYAML(t *testing.T) {
36
36
assert .NilError (t , err )
37
37
y .Images = nil // remove default images
38
38
y .Mounts = nil // remove default mounts
39
- t .Log (dumpJSON (y ))
39
+ t .Log (dumpJSON (t , y ))
40
40
b , err := marshalYAML (y )
41
41
assert .NilError (t , err )
42
42
assert .Equal (t , string (b ), defaultYAML )
You can’t perform that action at this time.
0 commit comments