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)
| 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." |
| 527 | func 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." |
nothing calls this directly
no test coverage detected