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

Function TestInsertStatementPosition

pkg/sql/ast/positions_test.go:123–136  ·  view source on GitHub ↗

----------------------------------------------------------------------------- TestInsertStatementPosition verifies INSERT statement position -----------------------------------------------------------------------------

(t *testing.T)

Source from the content-addressed store, hash-verified

121// -----------------------------------------------------------------------------
122
123func TestInsertStatementPosition(t *testing.T) {
124 tree := parseWithPositions(t, "INSERT INTO users (id, name) VALUES (1, 'Alice')")
125
126 if len(tree.Statements) != 1 {
127 t.Fatalf("expected 1 statement, got %d", len(tree.Statements))
128 }
129
130 ins, ok := tree.Statements[0].(*ast.InsertStatement)
131 if !ok {
132 t.Fatalf("expected *ast.InsertStatement, got %T", tree.Statements[0])
133 }
134
135 assertPosEqual(t, "INSERT.Pos", ins.Pos, 1, 1)
136}
137
138// -----------------------------------------------------------------------------
139// TestUpdateStatementPosition verifies UPDATE statement position

Callers

nothing calls this directly

Calls 3

parseWithPositionsFunction · 0.85
assertPosEqualFunction · 0.85
FatalfMethod · 0.65

Tested by

no test coverage detected