(t *testing.T)
| 438 | } |
| 439 | |
| 440 | func TestIsStructuredError(t *testing.T) { |
| 441 | structErr := NewError(ErrCodeUnexpectedToken, "test", models.Location{}) |
| 442 | simpleErr := fmt.Errorf("simple error") |
| 443 | |
| 444 | if !IsStructuredError(structErr) { |
| 445 | t.Error("IsStructuredError() should return true for structured error") |
| 446 | } |
| 447 | |
| 448 | if IsStructuredError(simpleErr) { |
| 449 | t.Error("IsStructuredError() should return false for simple error") |
| 450 | } |
| 451 | |
| 452 | if IsStructuredError(nil) { |
| 453 | t.Error("IsStructuredError() should return false for nil") |
| 454 | } |
| 455 | } |
| 456 | |
| 457 | func TestExtractLocation(t *testing.T) { |
| 458 | location := models.Location{Line: 5, Column: 10} |
nothing calls this directly
no test coverage detected