(t *testing.T)
| 40 | } |
| 41 | |
| 42 | func 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 | } |