diff options
| author | thatch <thatch@localhost> | 2008-10-08 20:08:20 -0700 |
|---|---|---|
| committer | thatch <thatch@localhost> | 2008-10-08 20:08:20 -0700 |
| commit | ffaf442c37bfef1d37c9f08a10f4b5ccd37e55bc (patch) | |
| tree | 98a3b4c77e164ae2b08d615a73bf68a9d2cdf4d6 /tests/test_basic_api.py | |
| parent | 3a507e951ebabdfc39812683b0cef73603aecf32 (diff) | |
| download | pygments-git-ffaf442c37bfef1d37c9f08a10f4b5ccd37e55bc.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): |
