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

Function TestBug1_ErrorPositionOnSecondLine

pkg/sql/parser/uat_bugs_test.go:83–92  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

81}
82
83func TestBug1_ErrorPositionOnSecondLine(t *testing.T) {
84 // Error is deliberately on line 2 to verify the line counter advances.
85 sql := "SELECT 1;\nSELECT FROM users"
86 err := parseExpectError(t, sql)
87
88 // The error string must mention line 2 somewhere.
89 if !strings.Contains(err.Error(), "line 2") {
90 t.Errorf("expected error to reference line 2, got: %v", err)
91 }
92}
93
94func TestBug1_ErrorPositionColumnNonZero(t *testing.T) {
95 // "SELECT id, FROM users" - the stray comma/FROM creates a parser error.

Callers

nothing calls this directly

Calls 3

parseExpectErrorFunction · 0.85
ErrorfMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected