----------------------------------------------------------------------------- TestBinaryExpressionPosition verifies BinaryExpression nodes carry positions -----------------------------------------------------------------------------
(t *testing.T)
| 259 | // ----------------------------------------------------------------------------- |
| 260 | |
| 261 | func TestBinaryExpressionPosition(t *testing.T) { |
| 262 | tree := parseWithPositions(t, "SELECT * FROM users WHERE id = 1") |
| 263 | |
| 264 | sel := tree.Statements[0].(*ast.SelectStatement) |
| 265 | if sel.Where == nil { |
| 266 | t.Fatal("expected WHERE clause") |
| 267 | } |
| 268 | |
| 269 | binExpr, ok := sel.Where.(*ast.BinaryExpression) |
| 270 | if !ok { |
| 271 | t.Fatalf("expected *ast.BinaryExpression in WHERE, got %T", sel.Where) |
| 272 | } |
| 273 | |
| 274 | assertPos(t, "BinaryExpression(=).Pos", binExpr.Pos) |
| 275 | } |
| 276 | |
| 277 | func TestANDExpressionPosition(t *testing.T) { |
| 278 | tree := parseWithPositions(t, "SELECT * FROM users WHERE id = 1 AND active = true") |
nothing calls this directly
no test coverage detected