summaryrefslogtreecommitdiff
path: root/compat/json/compat_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'compat/json/compat_test.go')
-rw-r--r--compat/json/compat_test.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/compat/json/compat_test.go b/compat/json/compat_test.go
index cf9e359..2380c53 100644
--- a/compat/json/compat_test.go
+++ b/compat/json/compat_test.go
@@ -79,7 +79,7 @@ func TestCompatCompact(t *testing.T) {
"hex-lower": {In: `"\uabcd"`, Out: `"\uabcd"`},
"hex-upper": {In: `"\uABCD"`, Out: `"\uABCD"`},
"hex-mixed": {In: `"\uAbCd"`, Out: `"\uAbCd"`},
- "invalid-utf8": {In: "\x85", Err: `invalid character '\u0085' looking for beginning of value`},
+ "invalid-utf8": {In: "\x85", Err: `invalid character '\x85' looking for beginning of value`},
}
for tcName, tc := range testcases {
tc := tc
@@ -120,7 +120,7 @@ func TestCompatIndent(t *testing.T) {
"hex-lower": {In: `"\uabcd"`, Out: `"\uabcd"`},
"hex-upper": {In: `"\uABCD"`, Out: `"\uABCD"`},
"hex-mixed": {In: `"\uAbCd"`, Out: `"\uAbCd"`},
- "invalid-utf8": {In: "\x85", Err: `invalid character '\u0085' looking for beginning of value`},
+ "invalid-utf8": {In: "\x85", Err: `invalid character '\x85' looking for beginning of value`},
}
for tcName, tc := range testcases {
tc := tc
@@ -183,7 +183,7 @@ func TestCompatUnmarshal(t *testing.T) {
"two-objs": {In: `{} {}`, ExpOut: nil, ExpErr: `invalid character '{' after top-level value`},
"two-numbers1": {In: `00`, ExpOut: nil, ExpErr: `invalid character '0' after top-level value`},
"two-numbers2": {In: `1 2`, ExpOut: nil, ExpErr: `invalid character '2' after top-level value`},
- "invalid-utf8": {In: "\x85", ExpErr: `invalid character '\u0085' looking for beginning of value`},
+ "invalid-utf8": {In: "\x85", ExpErr: `invalid character '\x85' looking for beginning of value`},
// 2e308 is slightly more than math.MaxFloat64 (~1.79e308)
"obj-overflow": {In: `{"foo":"bar", "baz":2e308, "qux": "orb"}`, ExpOut: map[string]any{"foo": "bar", "baz": nil, "qux": "orb"}, ExpErr: `json: cannot unmarshal number 2e308 into Go value of type float64`},
"ary-overflow": {In: `["foo",2e308,"bar",3e308]`, ExpOut: []any{"foo", nil, "bar", nil}, ExpErr: `json: cannot unmarshal number 2e308 into Go value of type float64`},
@@ -244,7 +244,7 @@ func TestCompatDecode(t *testing.T) {
"two-objs": {In: `{} {}`, ExpOut: map[string]any{}},
"two-numbers1": {In: `00`, ExpOut: float64(0)},
"two-numbers2": {In: `1 2`, ExpOut: float64(1)},
- "invalid-utf8": {In: "\x85", ExpErr: `invalid character '\u0085' looking for beginning of value`},
+ "invalid-utf8": {In: "\x85", ExpErr: `invalid character '\x85' looking for beginning of value`},
// 2e308 is slightly more than math.MaxFloat64 (~1.79e308)
"obj-overflow": {In: `{"foo":"bar", "baz":2e308, "qux": "orb"}`, ExpOut: map[string]any{"foo": "bar", "baz": nil, "qux": "orb"}, ExpErr: `json: cannot unmarshal number 2e308 into Go value of type float64`},
"ary-overflow": {In: `["foo",2e308,"bar",3e308]`, ExpOut: []any{"foo", nil, "bar", nil}, ExpErr: `json: cannot unmarshal number 2e308 into Go value of type float64`},