MCPcopy Create free account
hub / github.com/coder/coder / TestHasSVGRootElement

Function TestHasSVGRootElement

coderd/x/chatfiles/mime_test.go:349–357  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

347}
348
349func TestHasSVGRootElement(t *testing.T) {
350 t.Parallel()
351
352 require.True(t, chatfiles.HasSVGRootElement([]byte(`<?xml version="1.0"?><svg xmlns="http://www.w3.org/2000/svg"></svg>`)))
353 require.True(t, chatfiles.HasSVGRootElement([]byte("\xef\xbb\xbf<svg></svg>")))
354 require.False(t, chatfiles.HasSVGRootElement([]byte("<html><body>not svg</body></html>")))
355 require.False(t, chatfiles.HasSVGRootElement([]byte("# SVG Example\n<svg width=\"100\">...</svg>")))
356 require.False(t, chatfiles.HasSVGRootElement([]byte("name,icon\nlogo,<svg><rect/></svg>\n")))
357}

Callers

nothing calls this directly

Calls 1

HasSVGRootElementFunction · 0.92

Tested by

no test coverage detected