Skip to content

Commit a025e1c

Browse files
shawnpsbradfitz
authored andcommitted
html: add tests for UnescapeString edge cases
R=golang-dev, gobot, bradfitz CC=golang-dev https://golang.org/cl/40810044
1 parent c22e79b commit a025e1c

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/pkg/html/escape_test.go

+18
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,24 @@ var unescapeTests = []unescapeTest{
6464
"Footnote‡",
6565
"Footnote‡",
6666
},
67+
// Handle single ampersand.
68+
{
69+
"copySingleAmpersand",
70+
"&",
71+
"&",
72+
},
73+
// Handle ampersand followed by non-entity.
74+
{
75+
"copyAmpersandNonEntity",
76+
"text &test",
77+
"text &test",
78+
},
79+
// Handle "&#".
80+
{
81+
"copyAmpersandHash",
82+
"text &#",
83+
"text &#",
84+
},
6785
}
6886

6987
func TestUnescape(t *testing.T) {

0 commit comments

Comments
 (0)