blob: 9c980a8f9a8d47bfc4548ff105ec39c54efb6b11 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
package main
import "testing"
func TestUnxhtmlifyLine(t *testing.T) {
var tests = []struct {
input, expected string
}{
{ "<br />", "<br>" },
{ "<span>Bender / Flexo</span>", "<span>Bender / Flexo</span>" },
{ "<img src=\"farnsworth-paradox.jpg\" alt=\"Parabox\"/>", "<img src=\"farnsworth-paradox.jpg\" alt=\"Parabox\">" },
}
for _, c := range tests {
result := unxhtmlify_line(c.input)
if result != c.expected {
t.Errorf("unminify_line(%q) == %q, want %q", c.input, result, c.expected)
}
}
}
|