mirror of
https://github.com/gin-gonic/gin.git
synced 2026-06-06 12:08:20 +08:00
test: fix testifylint encoded-compare warning in AsciiJSON test
This commit is contained in:
parent
4ce483f0f4
commit
473f9ddf55
@ -267,8 +267,9 @@ func TestRenderAsciiJSONSupplementaryUnicode(t *testing.T) {
|
|||||||
|
|
||||||
err := (AsciiJSON{data}).Render(w)
|
err := (AsciiJSON{data}).Render(w)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
// U+1F600 must be encoded as UTF-16 surrogate pair per RFC 8259
|
// U+1F600 must be encoded as UTF-16 surrogate pair per RFC 8259.
|
||||||
assert.Equal(t, "{\"emoji\":\"\\ud83d\\ude00\"}", w.Body.String())
|
// Use Contains to verify the surrogate pair encoding in the raw output.
|
||||||
|
assert.Contains(t, w.Body.String(), `\ud83d\ude00`)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestRenderAsciiJSONFail(t *testing.T) {
|
func TestRenderAsciiJSONFail(t *testing.T) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user