You've already forked json-iterator
mirror of
https://github.com/json-iterator/go.git
synced 2025-06-24 23:16:47 +02:00
fix html escape test and omit empty
This commit is contained in:
@ -118,6 +118,7 @@ func Test_string_encode_with_std(t *testing.T) {
|
||||
}
|
||||
|
||||
func Test_string_encode_with_std_without_html_escape(t *testing.T) {
|
||||
api := Config{EscapeHtml: false}.Froze()
|
||||
should := require.New(t)
|
||||
for i := 0; i < utf8.RuneSelf; i++ {
|
||||
input := string([]byte{byte(i)})
|
||||
@ -128,7 +129,7 @@ func Test_string_encode_with_std_without_html_escape(t *testing.T) {
|
||||
should.Nil(err)
|
||||
stdOutput := buf.String()
|
||||
stdOutput = stdOutput[:len(stdOutput)-1]
|
||||
jsoniterOutputBytes, err := Marshal(input)
|
||||
jsoniterOutputBytes, err := api.Marshal(input)
|
||||
should.Nil(err)
|
||||
jsoniterOutput := string(jsoniterOutputBytes)
|
||||
should.Equal(stdOutput, jsoniterOutput)
|
||||
|
Reference in New Issue
Block a user