MCPcopy Create free account
hub / github.com/antchfx/xmlquery / TestChildNodes

Function TestChildNodes

node_test.go:120–132  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

118}
119
120func TestChildNodes(t *testing.T) {
121 t.Run("Has 3 children", func(t *testing.T) {
122 node := &Node{Type: ElementNode}
123
124 AddChild(node, &Node{Type: CommentNode})
125 AddChild(node, &Node{Type: ElementNode})
126 AddChild(node, &Node{Type: TextNode})
127
128 children := node.ChildNodes()
129
130 testTrue(t, len(children) == 3)
131 })
132}
133
134func TestAddAttr(t *testing.T) {
135 for _, test := range []struct {

Callers

nothing calls this directly

Calls 3

ChildNodesMethod · 0.95
AddChildFunction · 0.85
testTrueFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…