----------------------------------------------------------------------------- TestSelectStatementPosition verifies SELECT statement position -----------------------------------------------------------------------------
(t *testing.T)
| 73 | // ----------------------------------------------------------------------------- |
| 74 | |
| 75 | func TestSelectStatementPosition(t *testing.T) { |
| 76 | tree := parseWithPositions(t, "SELECT id, name FROM users") |
| 77 | |
| 78 | if len(tree.Statements) != 1 { |
| 79 | t.Fatalf("expected 1 statement, got %d", len(tree.Statements)) |
| 80 | } |
| 81 | |
| 82 | sel, ok := tree.Statements[0].(*ast.SelectStatement) |
| 83 | if !ok { |
| 84 | t.Fatalf("expected *ast.SelectStatement, got %T", tree.Statements[0]) |
| 85 | } |
| 86 | |
| 87 | assertPosEqual(t, "SELECT.Pos", sel.Pos, 1, 1) |
| 88 | } |
| 89 | |
| 90 | func TestSelectStatementPositionMultiLine(t *testing.T) { |
| 91 | // Two statements on separate lines: verify positions differ |
nothing calls this directly
no test coverage detected