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

Function TestUpdateStatementPosition

pkg/sql/ast/positions_test.go:142–155  ·  view source on GitHub ↗

----------------------------------------------------------------------------- TestUpdateStatementPosition verifies UPDATE statement position -----------------------------------------------------------------------------

(t *testing.T)

Source from the content-addressed store, hash-verified

140// -----------------------------------------------------------------------------
141
142func TestUpdateStatementPosition(t *testing.T) {
143 tree := parseWithPositions(t, "UPDATE users SET name = 'Bob' WHERE id = 1")
144
145 if len(tree.Statements) != 1 {
146 t.Fatalf("expected 1 statement, got %d", len(tree.Statements))
147 }
148
149 upd, ok := tree.Statements[0].(*ast.UpdateStatement)
150 if !ok {
151 t.Fatalf("expected *ast.UpdateStatement, got %T", tree.Statements[0])
152 }
153
154 assertPosEqual(t, "UPDATE.Pos", upd.Pos, 1, 1)
155}
156
157// -----------------------------------------------------------------------------
158// TestDeleteStatementPosition verifies DELETE statement position

Callers

nothing calls this directly

Calls 3

parseWithPositionsFunction · 0.85
assertPosEqualFunction · 0.85
FatalfMethod · 0.65

Tested by

no test coverage detected