(t *testing.T)
| 744 | } |
| 745 | |
| 746 | func TestVisitor_ConstantNode(t *testing.T) { |
| 747 | tree, err := parser.Parse(`re("[a-z]")`) |
| 748 | require.NoError(t, err) |
| 749 | |
| 750 | regexValue := regexp.MustCompile("[a-z]") |
| 751 | constNode := &ast.ConstantNode{Value: regexValue} |
| 752 | ast.Patch(&tree.Node, constNode) |
| 753 | |
| 754 | _, err = checker.Check(tree, nil) |
| 755 | assert.NoError(t, err) |
| 756 | assert.Equal(t, reflect.TypeOf(regexValue), tree.Node.Type()) |
| 757 | } |
| 758 | |
| 759 | func TestCheck_AsBool(t *testing.T) { |
| 760 | tree, err := parser.Parse(`1+2`) |
nothing calls this directly
no test coverage detected
searching dependent graphs…