MCPcopy Create free account
hub / github.com/cogentcore/core / TestHTML

Function TestHTML

htmlcore/html_test.go:14–33  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

12)
13
14func TestHTML(t *testing.T) {
15 tests := map[string]string{
16 "h1": `<h1>Test</h1>`,
17 "h2": `<h2>Test</h2>`,
18 "h3": `<h3>Test</h3>`,
19 "h4": `<h4>Test</h4>`,
20 "h5": `<h5>Test</h5>`,
21 "h6": `<h6>Test</h6>`,
22 "p": `<p>Test</p>`,
23 "ol": `<ol><li>Test</li></ol>`,
24 "ul": `<ul><li>Test</li></ul>`,
25 "button": `<button>Test</button>`,
26 "input": `<input value="Test">`,
27 }
28 for nm, s := range tests {
29 b := core.NewBody()
30 assert.NoError(t, ReadHTMLString(NewContext(), b, s))
31 b.AssertRender(t, "html/"+nm)
32 }
33}

Callers

nothing calls this directly

Calls 4

AssertRenderMethod · 0.95
NewBodyFunction · 0.92
ReadHTMLStringFunction · 0.85
NewContextFunction · 0.70

Tested by

no test coverage detected