Skip to content

Commit 7871171

Browse files
committed
add one more test
1 parent 409ad49 commit 7871171

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

modules/typesniffer/typesniffer_test.go

+4
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ func TestIsSvgImage(t *testing.T) {
5656
<!-- Multline
5757
Comment -->
5858
<svg></svg>`)).IsSvgImage())
59+
60+
// the DetectContentType should work for incomplete data, because only beginning bytes are used for detection
61+
assert.True(t, DetectContentType([]byte(`<svg>....`)).IsSvgImage())
62+
5963
assert.False(t, DetectContentType([]byte{}).IsSvgImage())
6064
assert.False(t, DetectContentType([]byte("svg")).IsSvgImage())
6165
assert.False(t, DetectContentType([]byte("<svgfoo></svgfoo>")).IsSvgImage())

0 commit comments

Comments
 (0)