(t *testing.T)
| 92 | } |
| 93 | |
| 94 | func TestBug1_ErrorPositionColumnNonZero(t *testing.T) { |
| 95 | // "SELECT id, FROM users" - the stray comma/FROM creates a parser error. |
| 96 | // Column should be non-zero. |
| 97 | err := parseExpectError(t, "SELECT id, FROM users") |
| 98 | |
| 99 | sErr, ok := err.(*goerrors.Error) |
| 100 | if !ok { |
| 101 | t.Logf("not a *goerrors.Error (%T); checking string representation", err) |
| 102 | return |
| 103 | } |
| 104 | |
| 105 | if sErr.Location.Line == 0 || sErr.Location.Column == 0 { |
| 106 | t.Errorf("expected non-zero line+column; got line=%d col=%d", |
| 107 | sErr.Location.Line, sErr.Location.Column) |
| 108 | } |
| 109 | } |
| 110 | |
| 111 | func TestBug1_SuccessfulParseDoesNotIntroducePositionRegression(t *testing.T) { |
| 112 | // Sanity check: successful parse should still work after the fix. |
nothing calls this directly
no test coverage detected