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

Function TestNestedFunctionCallPosition

pkg/sql/ast/positions_test.go:244–255  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

242}
243
244func TestNestedFunctionCallPosition(t *testing.T) {
245 tree := parseWithPositions(t, "SELECT SUM(amount) FROM orders")
246
247 sel := tree.Statements[0].(*ast.SelectStatement)
248
249 fn, ok := sel.Columns[0].(*ast.FunctionCall)
250 if !ok {
251 t.Fatalf("expected *ast.FunctionCall, got %T", sel.Columns[0])
252 }
253
254 assertPos(t, "FunctionCall(SUM).Pos", fn.Pos)
255}
256
257// -----------------------------------------------------------------------------
258// TestBinaryExpressionPosition verifies BinaryExpression nodes carry positions

Callers

nothing calls this directly

Calls 3

parseWithPositionsFunction · 0.85
assertPosFunction · 0.85
FatalfMethod · 0.65

Tested by

no test coverage detected