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

Function TestSpec_PublicAPI_FormatErrorWithSuggestions

pkg/console/spec_test.go:334–360  ·  view source on GitHub ↗

TestSpec_PublicAPI_FormatErrorWithSuggestions validates the documented behavior. Specification: "Formats an error message followed by a bulleted list of actionable suggestions. Returns an empty suggestions block when suggestions is nil or empty."

(t *testing.T)

Source from the content-addressed store, hash-verified

332// Specification: "Formats an error message followed by a bulleted list of actionable suggestions.
333// Returns an empty suggestions block when suggestions is nil or empty."
334func TestSpec_PublicAPI_FormatErrorWithSuggestions(t *testing.T) {
335 t.Run("with suggestions includes bulleted list", func(t *testing.T) {
336 result := FormatErrorWithSuggestions(
337 "Unknown engine 'myengine'",
338 []string{
339 "Valid engines are: copilot, claude, codex",
340 "Check your workflow frontmatter",
341 },
342 )
343 assert.Contains(t, result, "Valid engines are: copilot, claude, codex",
344 "formatted result should include each suggestion as documented")
345 assert.Contains(t, result, "Check your workflow frontmatter",
346 "formatted result should include each suggestion as documented")
347 })
348
349 t.Run("with nil suggestions returns non-empty (message only)", func(t *testing.T) {
350 result := FormatErrorWithSuggestions("Some error", nil)
351 assert.NotEmpty(t, result,
352 "result should be non-empty even with nil suggestions")
353 })
354
355 t.Run("with empty suggestions returns non-empty (message only)", func(t *testing.T) {
356 result := FormatErrorWithSuggestions("Some error", []string{})
357 assert.NotEmpty(t, result,
358 "result should be non-empty even with empty suggestions slice")
359 })
360}
361
362// TestSpec_PublicAPI_IsAccessibleMode validates the documented behavior.
363// Specification: "Returns true when the terminal is in accessibility mode based on environment variables:

Callers

nothing calls this directly

Calls 2

RunMethod · 0.45

Tested by

no test coverage detected