(t *testing.T)
| 452 | } |
| 453 | |
| 454 | func TestScan_HavingClause(t *testing.T) { |
| 455 | scanner := NewScanner() |
| 456 | |
| 457 | // SELECT ... HAVING 1=1 |
| 458 | selectStmt := &ast.SelectStatement{ |
| 459 | Columns: []ast.Expression{&ast.Identifier{Name: "COUNT(*)"}}, |
| 460 | Having: &ast.BinaryExpression{ |
| 461 | Left: &ast.LiteralValue{Value: "1", Type: "INTEGER"}, |
| 462 | Operator: "=", |
| 463 | Right: &ast.LiteralValue{Value: "1", Type: "INTEGER"}, |
| 464 | }, |
| 465 | } |
| 466 | |
| 467 | tree := &ast.AST{Statements: []ast.Statement{selectStmt}} |
| 468 | result := scanner.Scan(tree) |
| 469 | |
| 470 | if result.CriticalCount == 0 { |
| 471 | t.Error("expected critical finding for HAVING 1=1 tautology") |
| 472 | } |
| 473 | } |
| 474 | |
| 475 | func TestScan_NestedExpressions(t *testing.T) { |
| 476 | scanner := NewScanner() |
nothing calls this directly
no test coverage detected