]> Cypherpunks repositories - gostls13.git/commit
encoding/json: check exact structure of local error types in tests
authorJoe Tsai <joetsai@digital-static.net>
Tue, 19 Nov 2024 01:34:06 +0000 (17:34 -0800)
committerGopher Robot <gobot@golang.org>
Tue, 19 Nov 2024 18:48:19 +0000 (18:48 +0000)
commit99dad5281660c4e644602e0c8790dd24b3eb45f3
tree873d59b65580dc1a0e51ba351b4aba2740f7a5f0
parent4d6170427f4d02e79454b25391b56e7d1c5ceb39
encoding/json: check exact structure of local error types in tests

During the development of error wrapping (#29934),
the tests were modified to stop using reflect.DeepEqual
since the prototype for error wrapping at the time included
frame information of where the error was created.

However, that change diminished the fidelity of the test
so that it is no longer as strict, which affects the endeavor
to implement v1 in terms of the v2 prototype.

For locally declared error types, use reflect.DeepEqual
to check that the exact structure of the error value matches.

Change-Id: I443d418533866ab8d533bca3785fdc741e2c140e
Reviewed-on: https://go-review.googlesource.com/c/go/+/629517
Auto-Submit: Damien Neil <dneil@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/encoding/json/decode_test.go