aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2014-10-21 13:01:56 -0400
committerJesse Luehrs <doy@tozt.net>2014-10-21 13:01:56 -0400
commitdd00e1725bf79b0a0759690a229a78f1d94c1054 (patch)
treeb0ffe8ab115ba0766e84767a4f5b5b4b5edd4bcc
parent7a265e82a50b683c18e93734b1025d12fc985596 (diff)
downloadlibvt100-python-dd00e1725bf79b0a0759690a229a78f1d94c1054.tar.gz
libvt100-python-dd00e1725bf79b0a0759690a229a78f1d94c1054.zip
add tests for the default here too
-rw-r--r--t/csi_test.py29
1 files changed, 27 insertions, 2 deletions
diff --git a/t/csi_test.py b/t/csi_test.py
index 809513e..6b45dcf 100644
--- a/t/csi_test.py
+++ b/t/csi_test.py
@@ -78,24 +78,49 @@ class CSITest(VT100Test):
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("\033[2J\033[H")
+ 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[J")
+ assert self.vt.get_string_plaintext(0, 0, 500, 500) == 'foo' + ("\n" * 4) + ' bar' + ("\n" * 5) + ' ba' + ("\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;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)
+ self.process("\033[2J\033[H")
+ 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[?J")
+ assert self.vt.get_string_plaintext(0, 0, 500, 500) == 'foo' + ("\n" * 4) + ' bar' + ("\n" * 5) + ' ba' + ("\n" * 15)
+
def test_el(self):
assert self.vt.get_string_plaintext(0, 0, 500, 500) == ("\n" * 24)