(t *testing.T)
| 32 | } |
| 33 | |
| 34 | func 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 | |
| 42 | func TestDetectLogWithCodeKeywords(t *testing.T) { |
| 43 | e := engine.New(nil, nil) |