assertPos checks that a Location is non-zero (has been populated).
(t *testing.T, label string, loc models.Location)
| 53 | |
| 54 | // assertPos checks that a Location is non-zero (has been populated). |
| 55 | func assertPos(t *testing.T, label string, loc models.Location) { |
| 56 | t.Helper() |
| 57 | if loc.Line == 0 && loc.Column == 0 { |
| 58 | t.Errorf("%s: expected non-zero position, got line=%d col=%d", label, loc.Line, loc.Column) |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | // assertPosEqual checks that a Location matches expected values. |
| 63 | func assertPosEqual(t *testing.T, label string, loc models.Location, wantLine, wantCol int) { |
no test coverage detected