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

Function TestUnaryExpressionPosition

pkg/sql/ast/positions_test.go:302–316  ·  view source on GitHub ↗

----------------------------------------------------------------------------- TestUnaryExpressionPosition verifies UnaryExpression nodes carry positions -----------------------------------------------------------------------------

(t *testing.T)

Source from the content-addressed store, hash-verified

300// -----------------------------------------------------------------------------
301
302func TestUnaryExpressionPosition(t *testing.T) {
303 tree := parseWithPositions(t, "SELECT * FROM users WHERE NOT active")
304
305 sel := tree.Statements[0].(*ast.SelectStatement)
306 if sel.Where == nil {
307 t.Fatal("expected WHERE clause")
308 }
309
310 unary, ok := sel.Where.(*ast.UnaryExpression)
311 if !ok {
312 t.Fatalf("expected *ast.UnaryExpression, got %T", sel.Where)
313 }
314
315 assertPos(t, "UnaryExpression(NOT).Pos", unary.Pos)
316}
317
318// -----------------------------------------------------------------------------
319// TestJoinClausePosition verifies JoinClause 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