TestSpec_PublicAPI_NewFormattedParserError validates the documented behavior of NewFormattedParserError as described in the package README.md. Specification: Creates a pre-formatted parser error.
(t *testing.T)
| 645 | // |
| 646 | // Specification: Creates a pre-formatted parser error. |
| 647 | func TestSpec_PublicAPI_NewFormattedParserError(t *testing.T) { |
| 648 | t.Run("returns non-nil FormattedParserError implementing error", func(t *testing.T) { |
| 649 | msg := "error: bad import at line 5" |
| 650 | err := NewFormattedParserError(msg) |
| 651 | require.NotNil(t, err, "NewFormattedParserError should return a non-nil error") |
| 652 | var _ error = err |
| 653 | assert.Equal(t, msg, err.Error(), |
| 654 | "NewFormattedParserError.Error() should return the formatted message") |
| 655 | }) |
| 656 | |
| 657 | t.Run("empty message is preserved", func(t *testing.T) { |
| 658 | err := NewFormattedParserError("") |
| 659 | require.NotNil(t, err, "NewFormattedParserError should return non-nil for empty message") |
| 660 | assert.Empty(t, err.Error(), |
| 661 | "NewFormattedParserError should preserve empty message") |
| 662 | }) |
| 663 | } |
| 664 | |
| 665 | // TestSpec_PublicAPI_EnsureToolsSection validates the documented behavior of |
| 666 | // EnsureToolsSection as described in the package README.md. |
nothing calls this directly
no test coverage detected