diff options
author | thatch <devnull@localhost> | 2008-10-08 20:08:20 -0700 |
---|---|---|
committer | thatch <devnull@localhost> | 2008-10-08 20:08:20 -0700 |
commit | 3b2574fd7b64a01a7df795a7b0bbc8a1ffa298ab (patch) | |
tree | 98a3b4c77e164ae2b08d615a73bf68a9d2cdf4d6 /tests/test_basic_api.py | |
parent | e4eb439164fd41ae18aff84b552c58f081d9be30 (diff) | |
download | pygments-3b2574fd7b64a01a7df795a7b0bbc8a1ffa298ab.tar.gz |
Fix #368 by requiring word boundaries for codetag filter.
Diffstat (limited to 'tests/test_basic_api.py')
-rw-r--r-- | tests/test_basic_api.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_basic_api.py b/tests/test_basic_api.py index 1168c7ad..4126279c 100644 --- a/tests/test_basic_api.py +++ b/tests/test_basic_api.py @@ -121,6 +121,22 @@ class FiltersTest(unittest.TestCase): lxtext = ''.join([t[1] for t in list(lx.get_tokens(text))]) self.assert_('Def' in lxtext and 'Class' in lxtext) + def test_codetag(self): + lx = lexers.PythonLexer() + lx.add_filter('codetagify') + text = u'# BUG: text' + tokens = list(lx.get_tokens(text)) + self.assertEquals('# ', tokens[0][1]) + self.assertEquals('BUG', tokens[1][1]) + + def test_codetag_boundary(self): + # http://dev.pocoo.org/projects/pygments/ticket/368 + lx = lexers.PythonLexer() + lx.add_filter('codetagify') + text = u'# DEBUG: text' + tokens = list(lx.get_tokens(text)) + self.assertEquals('# DEBUG: text', tokens[0][1]) + class FormattersTest(unittest.TestCase): |