MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / TestParseTopClause_Percent

Function TestParseTopClause_Percent

pkg/sql/parser/select_helpers_test.go:149–160  ·  view source on GitHub ↗

TestParseTopClause_Percent checks TOP n PERCENT.

(t *testing.T)

Source from the content-addressed store, hash-verified

147
148// TestParseTopClause_Percent checks TOP n PERCENT.
149func TestParseTopClause_Percent(t *testing.T) {
150 stmt := parseSQLWithDialect(t,
151 "SELECT TOP 25 PERCENT salary FROM employees",
152 keywords.DialectSQLServer,
153 )
154 if stmt.Top == nil {
155 t.Fatal("expected non-nil TopClause")
156 }
157 if !stmt.Top.IsPercent {
158 t.Error("expected IsPercent=true for TOP PERCENT")
159 }
160}
161
162// TestParseTopClause_WithTies checks TOP n WITH TIES.
163func TestParseTopClause_WithTies(t *testing.T) {

Callers

nothing calls this directly

Calls 2

parseSQLWithDialectFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected