mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-05 07:26:47 +00:00
build(deps): Bump github.com/bytedance/sonic from 1.13.2 to 1.14.0 and fix test (#1984)
* build(deps): bump github.com/bytedance/sonic from 1.13.2 to 1.14.0 Bumps [github.com/bytedance/sonic](https://github.com/bytedance/sonic) from 1.13.2 to 1.14.0. - [Release notes](https://github.com/bytedance/sonic/releases) - [Commits](https://github.com/bytedance/sonic/compare/v1.13.2...v1.14.0) --- updated-dependencies: - dependency-name: github.com/bytedance/sonic dependency-version: 1.14.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * test: Enhance error handling in TestDateTimeUnmarshalJSON for unmarshal errors * test: Make comparison string more specific since there's no exported type we can use * test: Improve error handling in TestDateTimeUnmarshalJSON for sonic implementation --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
This commit is contained in:
@@ -84,7 +84,12 @@ func TestDateTimeUnmarshalJSON(t *testing.T) {
|
||||
jsonError *json.UnmarshalTypeError
|
||||
parseError *time.ParseError
|
||||
)
|
||||
require.ErrorAs(t, json.Unmarshal([]byte(`69`), &testTime), &jsonError)
|
||||
err := json.Unmarshal([]byte(`69`), &testTime)
|
||||
if json.Implementation == "bytedance/sonic" {
|
||||
require.ErrorContains(t, err, "Mismatch type string with value number", "Unmarshal must return the correct error text for sonic")
|
||||
} else {
|
||||
require.ErrorAs(t, err, &jsonError, "Unmarshal must return the correct error type for Go standard encoding/json")
|
||||
}
|
||||
require.ErrorAs(t, json.Unmarshal([]byte(`"2025"`), &testTime), &parseError)
|
||||
require.NoError(t, json.Unmarshal([]byte(`"2018-08-20 19:20:46"`), &testTime))
|
||||
assert.Equal(t, time.Date(2018, 8, 20, 19, 20, 46, 0, time.UTC), testTime.Time())
|
||||
|
||||
Reference in New Issue
Block a user