(t *testing.T)
| 275 | } |
| 276 | |
| 277 | func TestANDExpressionPosition(t *testing.T) { |
| 278 | tree := parseWithPositions(t, "SELECT * FROM users WHERE id = 1 AND active = true") |
| 279 | |
| 280 | sel := tree.Statements[0].(*ast.SelectStatement) |
| 281 | if sel.Where == nil { |
| 282 | t.Fatal("expected WHERE clause") |
| 283 | } |
| 284 | |
| 285 | // The outermost expression should be AND |
| 286 | andExpr, ok := sel.Where.(*ast.BinaryExpression) |
| 287 | if !ok { |
| 288 | t.Fatalf("expected *ast.BinaryExpression for AND, got %T", sel.Where) |
| 289 | } |
| 290 | |
| 291 | if andExpr.Operator != "AND" { |
| 292 | t.Errorf("expected AND operator, got %q", andExpr.Operator) |
| 293 | } |
| 294 | |
| 295 | assertPos(t, "BinaryExpression(AND).Pos", andExpr.Pos) |
| 296 | } |
| 297 | |
| 298 | // ----------------------------------------------------------------------------- |
| 299 | // TestUnaryExpressionPosition verifies UnaryExpression nodes carry positions |
nothing calls this directly
no test coverage detected