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

Function TestJoinClausePosition

pkg/sql/ast/positions_test.go:322–332  ·  view source on GitHub ↗

----------------------------------------------------------------------------- TestJoinClausePosition verifies JoinClause nodes carry positions -----------------------------------------------------------------------------

(t *testing.T)

Source from the content-addressed store, hash-verified

320// -----------------------------------------------------------------------------
321
322func TestJoinClausePosition(t *testing.T) {
323 tree := parseWithPositions(t, "SELECT u.id, o.total FROM users u JOIN orders o ON u.id = o.user_id")
324
325 sel := tree.Statements[0].(*ast.SelectStatement)
326 if len(sel.Joins) == 0 {
327 t.Fatal("expected at least 1 JOIN")
328 }
329
330 join := sel.Joins[0]
331 assertPos(t, "JoinClause.Pos", join.Pos)
332}
333
334// -----------------------------------------------------------------------------
335// TestMultipleStatementPositions verifies position accuracy in batches

Callers

nothing calls this directly

Calls 2

parseWithPositionsFunction · 0.85
assertPosFunction · 0.85

Tested by

no test coverage detected