From: Shawn Smith Date: Wed, 18 Dec 2013 18:20:25 +0000 (-0800) Subject: html: add tests for UnescapeString edge cases X-Git-Tag: go1.3beta1~1171 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=a025e1caac516c967486f4644fbe4c647100b632;p=gostls13.git html: add tests for UnescapeString edge cases R=golang-dev, gobot, bradfitz CC=golang-dev https://golang.org/cl/40810044 --- diff --git a/src/pkg/html/escape_test.go b/src/pkg/html/escape_test.go index b405d4b4a7..2d7ad8ac26 100644 --- a/src/pkg/html/escape_test.go +++ b/src/pkg/html/escape_test.go @@ -64,6 +64,24 @@ var unescapeTests = []unescapeTest{ "Footnote‡", "Footnote‡", }, + // Handle single ampersand. + { + "copySingleAmpersand", + "&", + "&", + }, + // Handle ampersand followed by non-entity. + { + "copyAmpersandNonEntity", + "text &test", + "text &test", + }, + // Handle "&#". + { + "copyAmpersandHash", + "text &#", + "text &#", + }, } func TestUnescape(t *testing.T) {