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

Function TestDECSTBMv3

vt/tests/emulate_test.go:98–128  ·  view source on GitHub ↗

TestDECSTBMv3 top and bottom

(t *testing.T)

Source from the content-addressed store, hash-verified

96
97// TestDECSTBMv3 top and bottom
98func TestDECSTBMv3(t *testing.T) {
99 term := vt.NewMockTerm(vt.MockOptSize{X: 8, Y: 4})
100 defer MustClose(t, term)
101 MustStart(t, term)
102
103 WriteF(t, term, "\033[1;1H") // move to top-left
104 WriteF(t, term, "\033[0J") // clear screen
105 WriteF(t, term, "ABC\r\n")
106 WriteF(t, term, "DEF\r\n")
107 WriteF(t, term, "GHI\r\n")
108 WriteF(t, term, "\033[1;2r") // scroll region top/bottom
109 WriteF(t, term, "\033[T") // scroll down one
110
111 // |________|
112 // |ABC_____|
113 // |GHI_____|
114 // |________|
115 CheckPos(t, term, 0, 0)
116 CheckContent(t, term, 0, 0, "")
117 CheckContent(t, term, 1, 0, "")
118 CheckContent(t, term, 2, 0, "")
119 CheckContent(t, term, 0, 1, "A")
120 CheckContent(t, term, 1, 1, "B")
121 CheckContent(t, term, 2, 1, "C")
122 CheckContent(t, term, 0, 2, "G")
123 CheckContent(t, term, 1, 2, "H")
124 CheckContent(t, term, 2, 2, "I")
125 CheckContent(t, term, 0, 3, "")
126 CheckContent(t, term, 1, 3, "")
127 CheckContent(t, term, 2, 3, "")
128}
129
130// TestDECSTBMv4 top == bottom
131func TestDECSTBMv4(t *testing.T) {

Callers

nothing calls this directly

Calls 6

NewMockTermFunction · 0.92
MustCloseFunction · 0.85
MustStartFunction · 0.85
WriteFFunction · 0.85
CheckPosFunction · 0.85
CheckContentFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…