1
0
mirror of https://github.com/json-iterator/go.git synced 2025-06-24 23:16:47 +02:00

#71 fix html escape for string alias

This commit is contained in:
Tao Wen
2017-06-26 09:57:45 +08:00
parent dcc91365ee
commit 81e64121ba
2 changed files with 94 additions and 4 deletions

View File

@ -101,6 +101,10 @@ func Test_html_escape(t *testing.T) {
output, err = ConfigCompatibleWithStandardLibrary.Marshal(`>`)
should.Nil(err)
should.Equal(`"\u003e"`, string(output))
type MyString string
output, err = ConfigCompatibleWithStandardLibrary.Marshal(MyString(`>`))
should.Nil(err)
should.Equal(`"\u003e"`, string(output))
}
func Test_string_encode_with_std(t *testing.T) {