summaryrefslogtreecommitdiff
path: root/tests/test_util.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2014-10-08 09:21:15 +0200
committerGeorg Brandl <georg@python.org>2014-10-08 09:21:15 +0200
commit444fb6fd9b3492040a36fcca672fee8175f8d603 (patch)
tree2bd411ca78decf276b95dc6b1788e594b2e35287 /tests/test_util.py
parent491fec23ef01687906f5d71ee718522cd2917926 (diff)
parentc1bfe4eed3805d3556bffa3c6b9cc2d3f6976205 (diff)
downloadpygments-444fb6fd9b3492040a36fcca672fee8175f8d603.tar.gz
Merged in leodemoura/pygments-main (pull request #399)
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'])