TestSpec_PublicAPI_FormatError validates the documented FormatError function. Specification: "Formats a structured CompilerError with position information, source context lines, and an optional fix hint."
(t *testing.T)
| 507 | // Specification: "Formats a structured CompilerError with position information, |
| 508 | // source context lines, and an optional fix hint." |
| 509 | func TestSpec_PublicAPI_FormatError(t *testing.T) { |
| 510 | // From the documented example |
| 511 | err := CompilerError{ |
| 512 | Position: ErrorPosition{File: "workflow.md", Line: 12, Column: 5}, |
| 513 | Type: "error", |
| 514 | Message: "unknown engine: 'myengine'", |
| 515 | Context: []string{"engine: myengine"}, |
| 516 | Hint: "Valid engines are: copilot, claude, codex, gemini, crush", |
| 517 | } |
| 518 | result := FormatError(err) |
| 519 | assert.NotEmpty(t, result, "FormatError should return non-empty output") |
| 520 | assert.Contains(t, result, "unknown engine: 'myengine'", |
| 521 | "FormatError output should contain the documented error message") |
| 522 | } |
| 523 | |
| 524 | // TestSpec_PublicAPI_FormatErrorChain validates the documented FormatErrorChain function. |
| 525 | // Specification: "Formats an error together with its entire %w-wrapped cause chain. |
nothing calls this directly
no test coverage detected