diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2023-02-14 18:55:57 -0700 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2023-02-25 17:07:32 -0700 |
commit | e38edfa53173c054ff97a5c51f90df0da60f16f5 (patch) | |
tree | 81393740a92395bf18a7d9cd2d751f2c2df5db2e /methods_test.go | |
parent | 051f966039028d257f27fc3a42c10cbff9f7c738 (diff) |
jsonparse: Reword error messages to match encoding/json
Diffstat (limited to 'methods_test.go')
-rw-r--r-- | methods_test.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/methods_test.go b/methods_test.go index 64af28c..23a6c4f 100644 --- a/methods_test.go +++ b/methods_test.go @@ -304,8 +304,8 @@ func TestMethodsDecode(t *testing.T) { testcases := map[string]testcase{ "decode-basic": {In: `{}`, Obj: &tstDecoder{n: 2}}, "decode-basic-eof": {In: `{}`, Obj: &tstDecoder{n: 5}}, - "decode-syntax-error": {In: `{x}`, Obj: &tstDecoder{n: 5}, ExpectedErr: `json: v: syntax error at input byte 1: object: unexpected character: 'x'`}, - "unmarshal-syntax-error": {In: `{x}`, Obj: &strUnmarshaler{}, ExpectedErr: `json: v: syntax error at input byte 1: object: unexpected character: 'x'`}, + "decode-syntax-error": {In: `{x}`, Obj: &tstDecoder{n: 5}, ExpectedErr: `json: v: syntax error at input byte 1: invalid character 'x' looking for beginning of object key string`}, + "unmarshal-syntax-error": {In: `{x}`, Obj: &strUnmarshaler{}, ExpectedErr: `json: v: syntax error at input byte 1: invalid character 'x' looking for beginning of object key string`}, "decode-short": {In: `{}`, Obj: &tstDecoder{n: 1}, ExpectedErr: `json: v: cannot decode JSON object at input byte 0 into Go *lowmemjson_test.tstDecoder: did not consume entire object`}, "decode-err": {In: `{}`, Obj: &tstDecoder{err: "xxx"}, ExpectedErr: `json: v: cannot decode JSON object at input byte 0 into Go *lowmemjson_test.tstDecoder: xxx`}, "decode-err2": {In: `{}`, Obj: &tstDecoder{n: 1, err: "yyy"}, ExpectedErr: `json: v: cannot decode JSON object at input byte 0 into Go *lowmemjson_test.tstDecoder: yyy`}, |