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

Function TestNoInlineContainer

htmlcore/context_test.go:26–35  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

24}
25
26func TestNoInlineContainer(t *testing.T) {
27 b := core.NewBody()
28 assert.NoError(t, ReadHTMLString(NewContext(), b, `<h1>Test</h1>`))
29 if tag := b.Child(0).AsTree().Property("tag"); tag != "body" {
30 t.Errorf("expected first child to be body but got %v", tag)
31 }
32 if strings.Contains(b.Child(0).AsTree().Child(0).AsTree().Name, "inline") {
33 t.Errorf("expected no inline container for h1 but got %v", b.Child(0))
34 }
35}

Callers

nothing calls this directly

Calls 8

NewBodyFunction · 0.92
ReadHTMLStringFunction · 0.85
PropertyMethod · 0.80
ChildMethod · 0.80
NewContextFunction · 0.70
AsTreeMethod · 0.65
ErrorfMethod · 0.65
ContainsMethod · 0.45

Tested by

no test coverage detected