MCPcopy Index your code
hub / github.com/github/gh-aw / TestSpec_PublicAPI_FormatError

Function TestSpec_PublicAPI_FormatError

pkg/console/spec_test.go:509–522  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

507// Specification: "Formats a structured CompilerError with position information,
508// source context lines, and an optional fix hint."
509func 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.

Callers

nothing calls this directly

Calls 1

FormatErrorFunction · 0.70

Tested by

no test coverage detected