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

Function TestNodeEmbedNewChild

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

Source from the content-addressed store, hash-verified

39}
40
41func TestNodeEmbedNewChild(t *testing.T) {
42 parent := testdata.NewNodeEmbed()
43 child := parent.NewChild(parent.NodeType())
44 child.AsTree().SetName("child1")
45 assert.Len(t, parent.Children, 1)
46 assert.Equal(t, "/node-embed/child1", child.AsTree().Path())
47 assert.Equal(t, parent.NodeType(), child.AsTree().NodeType())
48}
49
50func TestNodePath(t *testing.T) {
51 parent := testdata.NewNodeEmbed()

Callers

nothing calls this directly

Calls 8

NewNodeEmbedFunction · 0.92
NewChildMethod · 0.80
NodeTypeMethod · 0.80
EqualMethod · 0.80
SetNameMethod · 0.65
AsTreeMethod · 0.65
LenMethod · 0.65
PathMethod · 0.45

Tested by

no test coverage detected