MCPcopy
hub / github.com/cli/cli / TestStopAlternateScreenBuffer

Function TestStopAlternateScreenBuffer

pkg/iostreams/iostreams_test.go:10–25  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

8)
9
10func TestStopAlternateScreenBuffer(t *testing.T) {
11 ios, _, stdout, _ := Test()
12 ios.SetAlternateScreenBufferEnabled(true)
13
14 ios.StartAlternateScreenBuffer()
15 fmt.Fprint(ios.Out, "test")
16 ios.StopAlternateScreenBuffer()
17
18 // Stopping a subsequent time should no-op.
19 ios.StopAlternateScreenBuffer()
20
21 const want = "\x1b[?1049htest\x1b[?1049l"
22 if got := stdout.String(); got != want {
23 t.Errorf("after IOStreams.StopAlternateScreenBuffer() got %q, want %q", got, want)
24 }
25}
26
27func TestIOStreams_pager(t *testing.T) {
28 t.Skip("TODO: fix this test in race detection mode")

Callers

nothing calls this directly

Calls 6

TestFunction · 0.85
ErrorfMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected