MCPcopy Create free account
hub / github.com/github/gh-aw / TestSpec_PublicAPI_NewFormattedParserError

Function TestSpec_PublicAPI_NewFormattedParserError

pkg/parser/spec_test.go:647–663  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

645//
646// Specification: Creates a pre-formatted parser error.
647func 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.

Callers

nothing calls this directly

Calls 3

ErrorMethod · 0.95
NewFormattedParserErrorFunction · 0.85
RunMethod · 0.45

Tested by

no test coverage detected