diff options
Diffstat (limited to 'libgo/go/html/template/escape_test.go')
-rw-r--r-- | libgo/go/html/template/escape_test.go | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/libgo/go/html/template/escape_test.go b/libgo/go/html/template/escape_test.go index 70cada3..2bbb1b1 100644 --- a/libgo/go/html/template/escape_test.go +++ b/libgo/go/html/template/escape_test.go @@ -223,14 +223,14 @@ func TestEscape(t *testing.T) { `<button onclick='alert("\x3cHello\x3e")'>`, }, { - "badMarshaller", + "badMarshaler", `<button onclick='alert(1/{{.B}}in numbers)'>`, `<button onclick='alert(1/ /* json: error calling MarshalJSON for type *template.badMarshaler: invalid character 'f' looking for beginning of object key string */null in numbers)'>`, }, { - "jsMarshaller", + "jsMarshaler", `<button onclick='alert({{.M}})'>`, - `<button onclick='alert({"<foo>":"O'Reilly"})'>`, + `<button onclick='alert({"\u003cfoo\u003e":"O'Reilly"})'>`, }, { "jsStrNotUnderEscaped", @@ -432,6 +432,11 @@ func TestEscape(t *testing.T) { "<!DOCTYPE html>Hello, World!", }, { + "HTML doctype not case-insensitive", + "<!doCtYPE htMl>Hello, World!", + "<!doCtYPE htMl>Hello, World!", + }, + { "No doctype injection", `<!{{"DOCTYPE"}}`, "<!DOCTYPE", |