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

Function TestArithmeticBinaryExpressionPosition

pkg/sql/ast/positions_test.go:408–422  ·  view source on GitHub ↗

----------------------------------------------------------------------------- TestArithmeticBinaryExpressionPosition verifies positions in arithmetic -----------------------------------------------------------------------------

(t *testing.T)

Source from the content-addressed store, hash-verified

406// -----------------------------------------------------------------------------
407
408func TestArithmeticBinaryExpressionPosition(t *testing.T) {
409 tree := parseWithPositions(t, "SELECT price * 1.1 FROM products")
410
411 sel := tree.Statements[0].(*ast.SelectStatement)
412 if len(sel.Columns) == 0 {
413 t.Fatal("expected columns")
414 }
415
416 binExpr, ok := sel.Columns[0].(*ast.BinaryExpression)
417 if !ok {
418 t.Fatalf("expected *ast.BinaryExpression, got %T", sel.Columns[0])
419 }
420
421 assertPos(t, "BinaryExpression(*).Pos", binExpr.Pos)
422}

Callers

nothing calls this directly

Calls 3

parseWithPositionsFunction · 0.85
assertPosFunction · 0.85
FatalfMethod · 0.65

Tested by

no test coverage detected