diff options
author | Jesse Luehrs <doy@tozt.net> | 2014-10-20 18:21:42 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2014-10-20 18:21:42 -0400 |
commit | e576b1d52a12c48b06c76e9f75fadb1428c5b0d4 (patch) | |
tree | 8644dd5157b4a918c5d3dc2e3dfb7a991326d066 /t/__init__.py | |
parent | 2b01a56de9184b9e2112b6ed75f70d1a46ffd198 (diff) | |
download | libvt100-python-e576b1d52a12c48b06c76e9f75fadb1428c5b0d4.tar.gz libvt100-python-e576b1d52a12c48b06c76e9f75fadb1428c5b0d4.zip |
test that .process returns the correct value in all cases
Diffstat (limited to 't/__init__.py')
-rw-r--r-- | t/__init__.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/t/__init__.py b/t/__init__.py index 560d9da..130a085 100644 --- a/t/__init__.py +++ b/t/__init__.py @@ -5,3 +5,10 @@ import vt100 class VT100Test(unittest.TestCase): def setUp(self): self.vt = vt100.vt100(24, 80) + + def process(self, text): + if type(text) == type(""): + length = len(text.encode("utf-8")) + else: + length = len(text) + assert self.vt.process(text) == length |