summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTim Hatch <tim@timhatch.com>2014-10-21 16:44:14 -0700
committerTim Hatch <tim@timhatch.com>2014-10-21 16:44:14 -0700
commit9ebc6c73ab60b9616888cfdc97a4c24d7f437361 (patch)
tree549000a8fdac83b25abfc789b7f0b69f52441e4c /tests
parent8aa58e2c23026d2a5ad5c2112d791d1e73b68a01 (diff)
downloadpygments-9ebc6c73ab60b9616888cfdc97a4c24d7f437361.tar.gz
Add regexopt test for suffix ordering.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_regexopt.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test_regexopt.py b/tests/test_regexopt.py
index 66f7c609..02a8f56c 100644
--- a/tests/test_regexopt.py
+++ b/tests/test_regexopt.py
@@ -66,3 +66,11 @@ class RegexOptTestCase(unittest.TestCase):
self.assertFalse(rex.match('a'))
self.assertTrue(rex.match('a::'))
self.assertFalse(rex.match(':::')) # fullmatch
+
+ def test_suffix_opt(self):
+ # test that detected suffixes remain sorted.
+ opt = regex_opt(('afoo', 'abfoo'))
+ print(opt)
+ rex = re.compile(opt)
+ m = rex.match('abfoo')
+ self.assertEqual(5, m.end())