----------------------------------------------------------------------------- parseTopClause ----------------------------------------------------------------------------- TestParseTopClause_Basic checks a simple TOP n clause (SQL Server dialect).
(t *testing.T)
| 130 | |
| 131 | // TestParseTopClause_Basic checks a simple TOP n clause (SQL Server dialect). |
| 132 | func TestParseTopClause_Basic(t *testing.T) { |
| 133 | stmt := parseSQLWithDialect(t, |
| 134 | "SELECT TOP 10 id, name FROM users", |
| 135 | keywords.DialectSQLServer, |
| 136 | ) |
| 137 | if stmt.Top == nil { |
| 138 | t.Fatal("expected non-nil TopClause") |
| 139 | } |
| 140 | if stmt.Top.IsPercent { |
| 141 | t.Error("IsPercent should be false") |
| 142 | } |
| 143 | if stmt.Top.WithTies { |
| 144 | t.Error("WithTies should be false") |
| 145 | } |
| 146 | } |
| 147 | |
| 148 | // TestParseTopClause_Percent checks TOP n PERCENT. |
| 149 | func TestParseTopClause_Percent(t *testing.T) { |
nothing calls this directly
no test coverage detected