Skip to content

Commit 2eba28c

Browse files
committed
Fix build >_<
1 parent 848e2b2 commit 2eba28c

File tree

1 file changed

+7
-15
lines changed

1 file changed

+7
-15
lines changed

json.go

+7-15
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ func (r Test) CompareJSON(want, have any) Test {
2121
case []any:
2222
return r.cmpJSONArrays(w, have)
2323
default:
24-
return r.fail(
25-
"Key '%s' in expected output should be a map or a list of maps, but it's a %s",
26-
r.Key, fmtType(want))
24+
return r.fail("Key '%s' in expected output should be a map or a list of maps, but it's a %s", r.Key, fmtType(want))
2725
}
2826
}
2927

@@ -35,14 +33,10 @@ func (r Test) cmpJSONMaps(want map[string]any, have any) Test {
3533

3634
// Check to make sure both or neither are values.
3735
if isValue(want) && !isValue(haveMap) {
38-
return r.fail(
39-
"Key '%s' is supposed to be a value, but the parser reports it as a table",
40-
r.Key)
36+
return r.fail("Key '%s' is supposed to be a value, but the parser reports it as a table", r.Key)
4137
}
4238
if !isValue(want) && isValue(haveMap) {
43-
return r.fail(
44-
"Key '%s' is supposed to be a table, but the parser reports it as a value",
45-
r.Key)
39+
return r.fail("Key '%s' is supposed to be a table, but the parser reports it as a value", r.Key)
4640
}
4741
if isValue(want) && isValue(haveMap) {
4842
return r.cmpJSONValues(want, haveMap)
@@ -52,15 +46,13 @@ func (r Test) cmpJSONMaps(want map[string]any, have any) Test {
5246
for k := range want {
5347
if _, ok := haveMap[k]; !ok {
5448
bunk := r.kjoin(k)
55-
return bunk.fail("Could not find key '%s' in parser output.",
56-
bunk.Key)
49+
return bunk.fail("Could not find key '%s' in parser output.", bunk.Key)
5750
}
5851
}
5952
for k := range haveMap {
6053
if _, ok := want[k]; !ok {
6154
bunk := r.kjoin(k)
62-
return bunk.fail("Could not find key '%s' in expected output.",
63-
bunk.Key)
55+
return bunk.fail("Could not find key '%s' in expected output.", bunk.Key)
6456
}
6557
}
6658

@@ -241,10 +233,10 @@ func isValue(m map[string]any) bool {
241233
}
242234

243235
func (r Test) mismatch(wantType string, want, have any) Test {
244-
return r.fail("Key %[1]q is not %[2]q but %[5]q:\n"+
236+
return r.fail("Key %[1]q (type %[2]q):\n"+
245237
" Expected: %s\n"+
246238
" Your encoder: %s",
247-
r.Key, wantType, fmtHashV(want), fmtHashV(have), fmtType(have))
239+
r.Key, wantType, fmtHashV(have), fmtType(have))
248240
}
249241

250242
func (r Test) valMismatch(wantType, haveType string, want, have any) Test {

0 commit comments

Comments
 (0)