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

Function TestNodePath

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

Source from the content-addressed store, hash-verified

48}
49
50func TestNodePath(t *testing.T) {
51 parent := testdata.NewNodeEmbed()
52 child1 := parent.NewChild(parent.NodeType())
53 child2 := parent.NewChild(parent.NodeType())
54 child3 := parent.NewChild(parent.NodeType())
55 assert.Len(t, parent.Children, 3)
56 assert.Equal(t, "/node-embed/node-embed-0", child1.AsTree().Path())
57 assert.Equal(t, "/node-embed/node-embed-1", child2.AsTree().Path())
58 assert.Equal(t, "/node-embed/node-embed-2", child3.AsTree().Path())
59}
60
61func TestNodeEscapePaths(t *testing.T) {
62 parent := NewNodeBase()

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected