MCPcopy
hub / github.com/gdamore/tcell / TestOptAltScreenDisable

Function TestOptAltScreenDisable

tscreen_test.go:71–91  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

69}
70
71func TestOptAltScreenDisable(t *testing.T) {
72 t.Setenv("TCELL_ALTSCREEN", "")
73
74 tty := &spyTty{MockTerm: vt.NewMockTerm()}
75 s, err := NewTerminfoScreenFromTty(tty, OptAltScreen(false))
76 if err != nil {
77 t.Fatalf("failed to get screen: %v", err)
78 }
79 if err := s.Init(); err != nil {
80 t.Fatalf("failed to initialize screen: %v", err)
81 }
82 s.Fini()
83
84 out := tty.Output()
85 if strings.Contains(out, enterCA) {
86 t.Fatalf("alternate screen enter escape was emitted")
87 }
88 if strings.Contains(out, exitCA) {
89 t.Fatalf("alternate screen exit escape was emitted")
90 }
91}
92
93func TestOptAltScreenDefault(t *testing.T) {
94 t.Setenv("TCELL_ALTSCREEN", "")

Callers

nothing calls this directly

Calls 6

OutputMethod · 0.95
NewMockTermFunction · 0.92
NewTerminfoScreenFromTtyFunction · 0.85
OptAltScreenTypeAlias · 0.85
InitMethod · 0.65
FiniMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…