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

Function TestSpec_PublicAPI_IsAccessibleMode

pkg/console/spec_test.go:365–387  ·  view source on GitHub ↗

TestSpec_PublicAPI_IsAccessibleMode validates the documented behavior. Specification: "Returns true when the terminal is in accessibility mode based on environment variables: ACCESSIBLE is set, TERM is 'dumb', NO_COLOR is set."

(t *testing.T)

Source from the content-addressed store, hash-verified

363// Specification: "Returns true when the terminal is in accessibility mode based on environment variables:
364// ACCESSIBLE is set, TERM is 'dumb', NO_COLOR is set."
365func TestSpec_PublicAPI_IsAccessibleMode(t *testing.T) {
366 t.Run("ACCESSIBLE env var triggers accessible mode", func(t *testing.T) {
367 t.Setenv("ACCESSIBLE", "1")
368 assert.True(t, IsAccessibleMode(),
369 "IsAccessibleMode should return true when ACCESSIBLE env var is set")
370 })
371
372 t.Run("TERM=dumb triggers accessible mode", func(t *testing.T) {
373 t.Setenv("ACCESSIBLE", "")
374 t.Setenv("NO_COLOR", "")
375 t.Setenv("TERM", "dumb")
376 assert.True(t, IsAccessibleMode(),
377 "IsAccessibleMode should return true when TERM=dumb as documented")
378 })
379
380 t.Run("NO_COLOR env var triggers accessible mode", func(t *testing.T) {
381 t.Setenv("ACCESSIBLE", "")
382 t.Setenv("TERM", "xterm")
383 t.Setenv("NO_COLOR", "1")
384 assert.True(t, IsAccessibleMode(),
385 "IsAccessibleMode should return true when NO_COLOR env var is set")
386 })
387}
388
389// TestSpec_PublicAPI_RenderTable validates the documented RenderTable function.
390// Specification: "Renders a formatted table with optional title and total row."

Callers

nothing calls this directly

Calls 3

IsAccessibleModeFunction · 0.85
SetenvMethod · 0.80
RunMethod · 0.45

Tested by

no test coverage detected