mirror of
https://github.com/gin-gonic/gin.git
synced 2026-09-04 14:49:27 +08:00
fix(render): use assert.JSONEq for AsciiJSON non-BMP test
golangci-lint's testifylint rule flags comparing two JSON strings with assert.Equal, so switch to assert.JSONEq to satisfy CI.
This commit is contained in:
parent
6942b48b72
commit
541b0eb578
@ -272,7 +272,7 @@ func TestRenderAsciiJSONNonBMP(t *testing.T) {
|
||||
// U+1F600 is outside the Basic Multilingual Plane and must be encoded as
|
||||
// a UTF-16 surrogate pair (RFC 8259 §7), not a single \u escape with 5+
|
||||
// hex digits.
|
||||
assert.Equal(t, "{\"msg\":\"\\ud83d\\ude00\"}", w.Body.String())
|
||||
assert.JSONEq(t, "{\"msg\":\"\\ud83d\\ude00\"}", w.Body.String())
|
||||
|
||||
var decoded map[string]string
|
||||
require.NoError(t, json.Unmarshal(w.Body.Bytes(), &decoded))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user