aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/html
diff options
context:
space:
mode:
authorShawn Smith <shawn.p.smith@gmail.com>2013-12-18 10:20:25 -0800
committerBrad Fitzpatrick <bradfitz@golang.org>2013-12-18 10:20:25 -0800
commita025e1caac516c967486f4644fbe4c647100b632 (patch)
tree1e196578de52ca7641220111ea686be5c9111e35 /src/pkg/html
parentc22e79b37b95c1313ec9bee70147cade6461fb29 (diff)
downloadgo-a025e1caac516c967486f4644fbe4c647100b632.tar.xz
html: add tests for UnescapeString edge cases
R=golang-dev, gobot, bradfitz CC=golang-dev https://golang.org/cl/40810044
Diffstat (limited to 'src/pkg/html')
-rw-r--r--src/pkg/html/escape_test.go18
1 files changed, 18 insertions, 0 deletions
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&#x87;",
"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) {