summaryrefslogtreecommitdiff
path: root/tests/test_basic_api.py
diff options
context:
space:
mode:
authorthatch <devnull@localhost>2008-10-08 20:08:20 -0700
committerthatch <devnull@localhost>2008-10-08 20:08:20 -0700
commit3b2574fd7b64a01a7df795a7b0bbc8a1ffa298ab (patch)
tree98a3b4c77e164ae2b08d615a73bf68a9d2cdf4d6 /tests/test_basic_api.py
parente4eb439164fd41ae18aff84b552c58f081d9be30 (diff)
downloadpygments-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.py16
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):