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

Function TestDeleteStatementPosition

pkg/sql/ast/positions_test.go:161–174  ·  view source on GitHub ↗

----------------------------------------------------------------------------- TestDeleteStatementPosition verifies DELETE statement position -----------------------------------------------------------------------------

(t *testing.T)

Source from the content-addressed store, hash-verified

159// -----------------------------------------------------------------------------
160
161func TestDeleteStatementPosition(t *testing.T) {
162 tree := parseWithPositions(t, "DELETE FROM users WHERE id = 1")
163
164 if len(tree.Statements) != 1 {
165 t.Fatalf("expected 1 statement, got %d", len(tree.Statements))
166 }
167
168 del, ok := tree.Statements[0].(*ast.DeleteStatement)
169 if !ok {
170 t.Fatalf("expected *ast.DeleteStatement, got %T", tree.Statements[0])
171 }
172
173 assertPosEqual(t, "DELETE.Pos", del.Pos, 1, 1)
174}
175
176// -----------------------------------------------------------------------------
177// TestIdentifierPosition verifies Identifier nodes carry positions

Callers

nothing calls this directly

Calls 3

parseWithPositionsFunction · 0.85
assertPosEqualFunction · 0.85
FatalfMethod · 0.65

Tested by

no test coverage detected