aboutsummaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2014-10-21 12:12:53 -0400
committerJesse Luehrs <doy@tozt.net>2014-10-21 12:12:53 -0400
commit7a265e82a50b683c18e93734b1025d12fc985596 (patch)
tree24aededd574a53ab2ace803faa39fa78bea89ce9 /t
parentb8b13078725332087c7e7b321206c725ee4cda91 (diff)
downloadlibvt100-python-7a265e82a50b683c18e93734b1025d12fc985596.tar.gz
libvt100-python-7a265e82a50b683c18e93734b1025d12fc985596.zip
test for line clearing
Diffstat (limited to 't')
-rw-r--r--t/csi_test.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/t/csi_test.py b/t/csi_test.py
index f47a2d4..809513e 100644
--- a/t/csi_test.py
+++ b/t/csi_test.py
@@ -95,3 +95,39 @@ class CSITest(VT100Test):
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)
+
+ def test_el(self):
+ assert self.vt.get_string_plaintext(0, 0, 500, 500) == ("\n" * 24)
+
+ self.process("foo\033[5;5Hbarbar\033[10;10Hbazbaz\033[20;20Hquux")
+ assert self.vt.get_string_plaintext(0, 0, 500, 500) == 'foo' + ("\n" * 4) + ' barbar' + ("\n" * 5) + ' bazbaz' + ("\n" * 10) + ' quux' + ("\n" * 5)
+
+ self.process("\033[5;8H\033[0K")
+ assert self.vt.get_string_plaintext(0, 0, 500, 500) == 'foo' + ("\n" * 4) + ' bar' + ("\n" * 5) + ' bazbaz' + ("\n" * 10) + ' quux' + ("\n" * 5)
+
+ self.process("\033[10;13H\033[1K")
+ 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[20;22H\033[2K")
+ assert self.vt.get_string_plaintext(0, 0, 500, 500) == 'foo' + ("\n" * 4) + ' bar' + ("\n" * 5) + ' baz' + ("\n" * 15)
+
+ self.process("\033[1;2H\033[K")
+ assert self.vt.get_string_plaintext(0, 0, 500, 500) == 'f' + ("\n" * 4) + ' bar' + ("\n" * 5) + ' baz' + ("\n" * 15)
+
+ self.process("\033[2J\033[H")
+ assert self.vt.get_string_plaintext(0, 0, 500, 500) == ("\n" * 24)
+
+ self.process("foo\033[5;5Hbarbar\033[10;10Hbazbaz\033[20;20Hquux")
+ assert self.vt.get_string_plaintext(0, 0, 500, 500) == 'foo' + ("\n" * 4) + ' barbar' + ("\n" * 5) + ' bazbaz' + ("\n" * 10) + ' quux' + ("\n" * 5)
+
+ self.process("\033[5;8H\033[?0K")
+ assert self.vt.get_string_plaintext(0, 0, 500, 500) == 'foo' + ("\n" * 4) + ' bar' + ("\n" * 5) + ' bazbaz' + ("\n" * 10) + ' quux' + ("\n" * 5)
+
+ self.process("\033[10;13H\033[?1K")
+ 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[20;22H\033[?2K")
+ assert self.vt.get_string_plaintext(0, 0, 500, 500) == 'foo' + ("\n" * 4) + ' bar' + ("\n" * 5) + ' baz' + ("\n" * 15)
+
+ self.process("\033[1;2H\033[?K")
+ assert self.vt.get_string_plaintext(0, 0, 500, 500) == 'f' + ("\n" * 4) + ' bar' + ("\n" * 5) + ' baz' + ("\n" * 15)