1
0
mirror of https://github.com/json-iterator/go.git synced 2025-07-09 23:45:32 +02:00

separate 1.8 tests

This commit is contained in:
Tao Wen
2017-07-02 14:27:16 +08:00
parent 368bd0c1d8
commit c4f54740f7
3 changed files with 43 additions and 33 deletions

@ -121,25 +121,6 @@ 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)})
buf := &bytes.Buffer{}
encoder := json.NewEncoder(buf)
encoder.SetEscapeHTML(false)
err := encoder.Encode(input)
should.Nil(err)
stdOutput := buf.String()
stdOutput = stdOutput[:len(stdOutput)-1]
jsoniterOutputBytes, err := api.Marshal(input)
should.Nil(err)
jsoniterOutput := string(jsoniterOutputBytes)
should.Equal(stdOutput, jsoniterOutput)
}
}
func Test_unicode(t *testing.T) {
should := require.New(t)
output, _ := MarshalToString(map[string]interface{}{"a": "数字山谷"})