aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2014-10-20 16:02:00 -0400
committerJesse Luehrs <doy@tozt.net>2014-10-20 16:02:00 -0400
commit8891dfe9d941b1174588f51413b45c38cf6d456b (patch)
treecc8da939759fb13955f4b33ecbf72016960202a9
parentb36d52b2a8efc30084adfa2dcd5eccf561d795a1 (diff)
downloadlibvt100-python-8891dfe9d941b1174588f51413b45c38cf6d456b.tar.gz
libvt100-python-8891dfe9d941b1174588f51413b45c38cf6d456b.zip
more tests
-rw-r--r--t/osc_test.py37
1 files changed, 37 insertions, 0 deletions
diff --git a/t/osc_test.py b/t/osc_test.py
new file mode 100644
index 0000000..d2b5438
--- /dev/null
+++ b/t/osc_test.py
@@ -0,0 +1,37 @@
+from . import VT100Test
+
+class OSCTest(VT100Test):
+ def test_title(self):
+ assert self.vt.title() == ""
+ assert self.vt.icon_name() == ""
+ self.vt.process("\033]2;it's a title\007")
+ assert self.vt.title() == "it's a title"
+ assert self.vt.icon_name() == ""
+ self.vt.process("\033]2;\007")
+ assert self.vt.title() == ""
+ assert self.vt.icon_name() == ""
+
+ def test_icon_name(self):
+ assert self.vt.title() == ""
+ assert self.vt.icon_name() == ""
+ self.vt.process("\033]1;it's an icon name\007")
+ assert self.vt.title() == ""
+ assert self.vt.icon_name() == "it's an icon name"
+ self.vt.process("\033]1;\007")
+ assert self.vt.title() == ""
+ assert self.vt.icon_name() == ""
+
+ def test_title_icon_name(self):
+ assert self.vt.title() == ""
+ assert self.vt.icon_name() == ""
+ self.vt.process("\033]0;it's both\007")
+ assert self.vt.title() == "it's both"
+ assert self.vt.icon_name() == "it's both"
+ self.vt.process("\033]0;\007")
+ assert self.vt.title() == ""
+ assert self.vt.icon_name() == ""
+
+ def test_unknown_sequence(self):
+ assert self.vt.cell(0, 0).contents() == ""
+ self.vt.process("\033]499;some long, long string?\007")
+ assert self.vt.cell(0, 0).contents() == ""