diff options
| author | Shawn Smith <shawn.p.smith@gmail.com> | 2013-12-18 10:20:25 -0800 |
|---|---|---|
| committer | Brad Fitzpatrick <bradfitz@golang.org> | 2013-12-18 10:20:25 -0800 |
| commit | a025e1caac516c967486f4644fbe4c647100b632 (patch) | |
| tree | 1e196578de52ca7641220111ea686be5c9111e35 /src/pkg/html | |
| parent | c22e79b37b95c1313ec9bee70147cade6461fb29 (diff) | |
| download | go-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.go | 18 |
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‡", "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) { |
