MCPcopy Create free account
hub / github.com/JuliusBrussee/caveman / TestDetectGoWithHTMLStringsNotHTML

Function TestDetectGoWithHTMLStringsNotHTML

engine/detect_html_test.go:34–40  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

32}
33
34func TestDetectGoWithHTMLStringsNotHTML(t *testing.T) {
35 e := engine.New(nil, nil)
36 src := "package render\n\nfunc wrap(s string) string {\n\treturn \"<div><p>\" + s + \"</p></div>\"\n}\n\nfunc tag() string {\n\treturn \"<span>x</span>\"\n}\n"
37 if got := e.Detect([]byte(src)); got == engine.TypeHTML {
38 t.Errorf("Go source embedding HTML strings must not route to html, got %q", got)
39 }
40}
41
42func TestDetectLogWithCodeKeywords(t *testing.T) {
43 e := engine.New(nil, nil)

Callers

nothing calls this directly

Calls 2

NewFunction · 0.92
DetectMethod · 0.80

Tested by

no test coverage detected