summaryrefslogtreecommitdiff
path: root/tests/test_util.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2014-10-08 09:09:18 +0200
committerGeorg Brandl <georg@python.org>2014-10-08 09:09:18 +0200
commit6d063d8d28bda60f37b03c7fe130074f92932398 (patch)
tree946af08ab0d46558c58b246dd5d13fee9bcdfae3 /tests/test_util.py
parent342f9b5f2720ab257cea0ca934f1c82d9cbfab72 (diff)
parentac3a01c3b86d36b4dc88a11dfe2dfe042ea1c208 (diff)
downloadpygments-6d063d8d28bda60f37b03c7fe130074f92932398.tar.gz
Merged in protz/pygments-main/add-envname (pull request #235)
Diffstat (limited to 'tests/test_util.py')
-rw-r--r--tests/test_util.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/tests/test_util.py b/tests/test_util.py
index dbbc66ce..7bf03409 100644
--- a/tests/test_util.py
+++ b/tests/test_util.py
@@ -3,7 +3,7 @@
Test suite for the util module
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
+ :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
@@ -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'])