diff options
author | Georg Brandl <georg@python.org> | 2014-10-08 08:50:24 +0200 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2014-10-08 08:50:24 +0200 |
commit | ab509e4ea2a8bd3c7e8e355b0e83b3e2de9f7a01 (patch) | |
tree | db1c94d9d2ba3fc0c664b71ba798007eb0da5a65 /tests/test_util.py | |
parent | 7f5c98a36c3a8e1b9877e1d4cfe41fd00f08833a (diff) | |
parent | e07ba8bf31d7a9ee2cfd4832608a9453a9f81fbe (diff) | |
download | pygments-ab509e4ea2a8bd3c7e8e355b0e83b3e2de9f7a01.tar.gz |
Merged in __russ__/pygments-main (pull request #165)
Diffstat (limited to 'tests/test_util.py')
-rw-r--r-- | tests/test_util.py | 14 |
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']) |