Skip to content

Commit 5683c0c

Browse files
committed
add doctype tests
1 parent eefd258 commit 5683c0c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

modules/base/tool_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,9 @@ func TestIsSVGImageFile(t *testing.T) {
216216
assert.True(t, IsSVGImageFile([]byte(`<!-- Multiline
217217
Comment -->
218218
<svg></svg>`)))
219+
assert.True(t, IsSVGImageFile([]byte(`<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Basic//EN"
220+
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd">
221+
<svg></svg>`)))
219222
assert.True(t, IsSVGImageFile([]byte(`<?xml version="1.0" encoding="UTF-8"?>
220223
<!-- Comment -->
221224
<svg></svg>`)))
@@ -227,6 +230,11 @@ func TestIsSVGImageFile(t *testing.T) {
227230
<!-- Multline
228231
Comment -->
229232
<svg></svg>`)))
233+
assert.True(t, IsSVGImageFile([]byte(`<?xml version="1.0" encoding="UTF-8"?>
234+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
235+
<!-- Multline
236+
Comment -->
237+
<svg></svg>`)))
230238
assert.False(t, IsSVGImageFile([]byte{}))
231239
assert.False(t, IsSVGImageFile([]byte("svg")))
232240
assert.False(t, IsSVGImageFile([]byte("<svgfoo></svgfoo>")))

0 commit comments

Comments
 (0)