From e576b1d52a12c48b06c76e9f75fadb1428c5b0d4 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Mon, 20 Oct 2014 18:21:42 -0400 Subject: test that .process returns the correct value in all cases --- t/__init__.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 't/__init__.py') 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 -- cgit v1.2.3-54-g00ecf