MCPcopy Index your code
hub / github.com/expr-lang/expr / TestWalk_patch

Function TestWalk_patch

ast/visitor_test.go:42–54  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

40}
41
42func TestWalk_patch(t *testing.T) {
43 var node ast.Node
44 node = &ast.BinaryNode{
45 Operator: "+",
46 Left: &ast.IdentifierNode{Value: "foo"},
47 Right: &ast.IdentifierNode{Value: "bar"},
48 }
49
50 patcher := &patcher{}
51 ast.Walk(&node, patcher)
52 assert.IsType(t, &ast.NilNode{}, node.(*ast.BinaryNode).Left)
53 assert.IsType(t, &ast.NilNode{}, node.(*ast.BinaryNode).Right)
54}

Callers

nothing calls this directly

Calls 2

WalkFunction · 0.92
IsTypeFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…