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

Function TestSpec_PublicAPI_FormatErrorChain

pkg/console/spec_test.go:527–538  ·  view source on GitHub ↗

TestSpec_PublicAPI_FormatErrorChain validates the documented FormatErrorChain function. Specification: "Formats an error together with its entire %w-wrapped cause chain. Each level of the chain is shown on a new indented line for easy debugging."

(t *testing.T)

Source from the content-addressed store, hash-verified

525// Specification: "Formats an error together with its entire %w-wrapped cause chain.
526// Each level of the chain is shown on a new indented line for easy debugging."
527func TestSpec_PublicAPI_FormatErrorChain(t *testing.T) {
528 inner := errors.New("network failure")
529 middle := fmt.Errorf("dial failed: %w", inner)
530 outer := fmt.Errorf("connection refused: %w", middle)
531
532 result := FormatErrorChain(outer)
533 assert.NotEmpty(t, result, "FormatErrorChain should return non-empty output")
534 assert.Contains(t, result, "connection refused",
535 "FormatErrorChain output should include the outermost error")
536 assert.Contains(t, result, "network failure",
537 "FormatErrorChain output should include the deepest wrapped cause")
538}
539
540// TestSpec_PublicAPI_RenderErrorBox validates the documented RenderErrorBox function.
541// Specification: "Returns a red-bordered error box displaying title."

Callers

nothing calls this directly

Calls 2

FormatErrorChainFunction · 0.85
ErrorfMethod · 0.45

Tested by

no test coverage detected