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

Function TestSpec_PublicAPI_IsStdoutTerminal

pkg/tty/spec_test.go:15–21  ·  view source on GitHub ↗

TestSpec_PublicAPI_IsStdoutTerminal validates the documented behavior of IsStdoutTerminal as described in the tty package README.md specification. Spec: "Returns true if stdout (os.Stdout) is connected to a terminal."

(t *testing.T)

Source from the content-addressed store, hash-verified

13// as described in the tty package README.md specification.
14// Spec: "Returns true if stdout (os.Stdout) is connected to a terminal."
15func TestSpec_PublicAPI_IsStdoutTerminal(t *testing.T) {
16 result1 := tty.IsStdoutTerminal()
17 result2 := tty.IsStdoutTerminal()
18 // Spec (Design Notes): "Terminal detection is evaluated at call time, not cached."
19 // In the same unmodified context, consecutive calls must return the same result.
20 assert.Equal(t, result1, result2, "consecutive calls in the same context must return the same result")
21}
22
23// TestSpec_PublicAPI_IsStderrTerminal validates the documented behavior of IsStderrTerminal
24// as described in the tty package README.md specification.

Callers

nothing calls this directly

Calls 1

IsStdoutTerminalFunction · 0.92

Tested by

no test coverage detected