aboutsummaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2014-10-21 00:04:55 -0400
committerJesse Luehrs <doy@tozt.net>2014-10-21 00:04:55 -0400
commitb8b13078725332087c7e7b321206c725ee4cda91 (patch)
tree9754205b345301f321747f46f465718564e1ff85 /t
parent000d4a5a8576a280086fb8645dee72b84fab49fe (diff)
downloadlibvt100-python-b8b13078725332087c7e7b321206c725ee4cda91.tar.gz
libvt100-python-b8b13078725332087c7e7b321206c725ee4cda91.zip
tests for screen clears
Diffstat (limited to 't')
-rw-r--r--t/csi_test.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/t/csi_test.py b/t/csi_test.py
index 44d207c..f47a2d4 100644
--- a/t/csi_test.py
+++ b/t/csi_test.py
@@ -72,3 +72,26 @@ class CSITest(VT100Test):
self.process("\033[500A")
assert self.vt.cursor_pos() == (0, 0)
+
+ def test_ed(self):
+ assert self.vt.get_string_plaintext(0, 0, 500, 500) == ("\n" * 24)
+
+ self.process("foo\033[5;5Hbar\033[10;10Hbaz\033[20;20Hquux")
+ assert self.vt.get_string_plaintext(0, 0, 500, 500) == 'foo' + ("\n" * 4) + ' bar' + ("\n" * 5) + ' baz' + ("\n" * 10) + ' quux' + ("\n" * 5)
+ self.process("\033[10;12H\033[0J")
+ assert self.vt.get_string_plaintext(0, 0, 500, 500) == 'foo' + ("\n" * 4) + ' bar' + ("\n" * 5) + ' ba' + ("\n" * 15)
+ self.process("\033[5;7H\033[1J")
+ assert self.vt.get_string_plaintext(0, 0, 500, 500) == ("\n" * 4) + ' r' + ("\n" * 5) + ' ba' + ("\n" * 15)
+ self.process("\033[7;7H\033[2J")
+ assert self.vt.get_string_plaintext(0, 0, 500, 500) == ("\n" * 24)
+
+ self.process("\033[H")
+ self.process("foo\033[5;5Hbar\033[10;10Hbaz\033[20;20Hquux")
+ assert self.vt.get_string_plaintext(0, 0, 500, 500) == 'foo' + ("\n" * 4) + ' bar' + ("\n" * 5) + ' baz' + ("\n" * 10) + ' quux' + ("\n" * 5)
+ self.process("\033[10;12H\033[?0J")
+ assert self.vt.get_string_plaintext(0, 0, 500, 500) == 'foo' + ("\n" * 4) + ' bar' + ("\n" * 5) + ' ba' + ("\n" * 15)
+ self.process("\033[5;7H\033[?1J")
+ print(self.vt.get_string_plaintext(0, 0, 500, 500).replace('\n', '\\n'))
+ assert self.vt.get_string_plaintext(0, 0, 500, 500) == ("\n" * 4) + ' r' + ("\n" * 5) + ' ba' + ("\n" * 15)
+ self.process("\033[7;7H\033[?2J")
+ assert self.vt.get_string_plaintext(0, 0, 500, 500) == ("\n" * 24)