summaryrefslogtreecommitdiff
path: root/tests/test_util.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_util.py')
-rw-r--r--tests/test_util.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/test_util.py b/tests/test_util.py
index 59ecf14f..7bf03409 100644
--- a/tests/test_util.py
+++ b/tests/test_util.py
@@ -123,7 +123,7 @@ class UtilTest(unittest.TestCase):
r = re.compile(util.unirange(0x10000, 0x20000))
m = r.match(first_non_bmp)
self.assertTrue(m)
- self.assertEquals(m.end(), len(first_non_bmp))
+ self.assertEqual(m.end(), len(first_non_bmp))
self.assertFalse(r.match(u'\uffff'))
self.assertFalse(r.match(u'xxx'))
# Tests that end is inclusive
@@ -132,4 +132,12 @@ class UtilTest(unittest.TestCase):
# build
m = r.match(first_non_bmp * 2)
self.assertTrue(m)
- self.assertEquals(m.end(), len(first_non_bmp) * 2)
+ self.assertEqual(m.end(), len(first_non_bmp) * 2)
+
+ def test_format_lines(self):
+ lst = ['cat', 'dog']
+ output = util.format_lines('var', lst)
+ d = {}
+ exec(output, d)
+ self.assertTrue(isinstance(d['var'], tuple))
+ self.assertEqual(('cat', 'dog'), d['var'])