1
0
mirror of https://github.com/golang/go synced 2024-11-22 04:14:42 -07:00

html/template: encoding/json does more escaping now, so update the html/template test that uses it.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5714052
This commit is contained in:
David Symonds 2012-03-01 17:52:05 +11:00
parent 99e45e49b7
commit 289a1638aa

View File

@ -223,14 +223,14 @@ func TestEscape(t *testing.T) {
`<button onclick='alert(&quot;\x3cHello\x3e&quot;)'>`,
},
{
"badMarshaller",
"badMarshaler",
`<button onclick='alert(1/{{.B}}in numbers)'>`,
`<button onclick='alert(1/ /* json: error calling MarshalJSON for type *template.badMarshaler: invalid character &#39;f&#39; looking for beginning of object key string */null in numbers)'>`,
},
{
"jsMarshaller",
"jsMarshaler",
`<button onclick='alert({{.M}})'>`,
`<button onclick='alert({&#34;&lt;foo&gt;&#34;:&#34;O&#39;Reilly&#34;})'>`,
`<button onclick='alert({&#34;\u003cfoo\u003e&#34;:&#34;O&#39;Reilly&#34;})'>`,
},
{
"jsStrNotUnderEscaped",