(t *testing.T)
| 993 | } |
| 994 | |
| 995 | func TestRoundtrip(t *testing.T) { |
| 996 | tests := []ast.Constant{ |
| 997 | ast.String("foo"), |
| 998 | ast.String(`fo"\o`), |
| 999 | ast.String(`"`), |
| 1000 | } |
| 1001 | for _, c := range tests { |
| 1002 | parsed, err := BaseTerm(c.String()) |
| 1003 | if err != nil { |
| 1004 | t.Fatalf("BaseTerm(%v) failed with %v", c, err) |
| 1005 | } |
| 1006 | if !c.Equals(parsed) { |
| 1007 | t.Errorf("BaseTerm(%v) = %v want %v", c, parsed, c) |
| 1008 | } |
| 1009 | } |
| 1010 | } |
| 1011 | |
| 1012 | func TestPredicateNamePositive(t *testing.T) { |
| 1013 | tests := []struct { |