diff options
author | Jesse Luehrs <doy@tozt.net> | 2014-10-22 11:58:38 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2014-10-22 11:58:38 -0400 |
commit | 83f098f45410a4e3fb4fe5953e77a8392d0e2bf5 (patch) | |
tree | 127da442fc5461de4aab502ed8e8accc4be6a77a /t/mode_test.py | |
parent | 54e9c6ecce40c3b24271be616c88b9ec05ce9043 (diff) | |
download | libvt100-python-83f098f45410a4e3fb4fe5953e77a8392d0e2bf5.tar.gz libvt100-python-83f098f45410a4e3fb4fe5953e77a8392d0e2bf5.zip |
test for alternate buffer
Diffstat (limited to 't/mode_test.py')
-rw-r--r-- | t/mode_test.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/t/mode_test.py b/t/mode_test.py index cfc50cb..7332b1e 100644 --- a/t/mode_test.py +++ b/t/mode_test.py @@ -186,3 +186,13 @@ class ModeTest(VT100Test): assert not self.vt.mouse_reporting_button_motion() assert not self.vt.mouse_reporting_sgr_mode() assert not self.vt.bracketed_paste() + + def test_alternate_buffer(self): + self.process("\033[m\033[2J\033[H1\r\n2\r\n3\r\n4\r\n5\r\n6\r\n7\r\n8\r\n9\r\n10\r\n11\r\n12\r\n13\r\n14\r\n15\r\n16\r\n17\r\n18\r\n19\r\n20\r\n21\r\n22\r\n23\r\n24") + assert self.vt.window_contents() == "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n" + self.process("\033[?1049h") + assert self.vt.window_contents() == ('\n' * 24) + self.process("foobar") + assert self.vt.window_contents() == 'foobar' + ('\n' * 24) + self.process("\033[?1049l") + assert self.vt.window_contents() == "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n" |