diff options
| author | David Symonds <dsymonds@golang.org> | 2013-07-12 14:35:55 +1000 |
|---|---|---|
| committer | David Symonds <dsymonds@golang.org> | 2013-07-12 14:35:55 +1000 |
| commit | d754647963d41bcd96ea4d12d824f01e8c50f076 (patch) | |
| tree | 183944767d37274c69b366ec9d3d5ee7ceb6da16 /src/pkg/encoding/json/decode_test.go | |
| parent | fb63e4fefbb1325a21f643febc97987c82fcae7a (diff) | |
| download | go-d754647963d41bcd96ea4d12d824f01e8c50f076.tar.xz | |
encoding/json: escape U+2028 and U+2029.
Fixes #5836.
R=golang-dev, bradfitz, r, rsc
CC=golang-dev
https://golang.org/cl/10883045
Diffstat (limited to 'src/pkg/encoding/json/decode_test.go')
| -rw-r--r-- | src/pkg/encoding/json/decode_test.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/pkg/encoding/json/decode_test.go b/src/pkg/encoding/json/decode_test.go index 97cbb4f09b..1191d6cee5 100644 --- a/src/pkg/encoding/json/decode_test.go +++ b/src/pkg/encoding/json/decode_test.go @@ -568,14 +568,14 @@ func TestUnmarshalPtrPtr(t *testing.T) { } func TestEscape(t *testing.T) { - const input = `"foobar"<html>` - const expected = `"\"foobar\"\u003chtml\u003e"` + const input = `"foobar"<html>` + " [\u2028 \u2029]" + const expected = `"\"foobar\"\u003chtml\u003e [\u2028 \u2029]"` b, err := Marshal(input) if err != nil { t.Fatalf("Marshal error: %v", err) } if s := string(b); s != expected { - t.Errorf("Encoding of [%s] was [%s], want [%s]", input, s, expected) + t.Errorf("Encoding of [%s]:\n got [%s]\nwant [%s]", input, s, expected) } } |
