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

Function TestNodeAddChild

tree/node_test.go:21–29  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

19)
20
21func TestNodeAddChild(t *testing.T) {
22 parent := NewNodeBase()
23 child := &NodeBase{}
24 parent.AddChild(child)
25 child.SetName("child1")
26 assert.Equal(t, 1, len(parent.Children))
27 assert.Equal(t, parent, child.Parent)
28 assert.Equal(t, "/node-base/child1", child.Path())
29}
30
31func TestNodeEmbedAddChild(t *testing.T) {
32 parent := testdata.NewNodeEmbed()

Callers

nothing calls this directly

Calls 5

AddChildMethod · 0.95
SetNameMethod · 0.95
PathMethod · 0.95
EqualMethod · 0.80
NewNodeBaseFunction · 0.70

Tested by

no test coverage detected