diff tests/run-tests.py @ 38290:b5651ae53127

run-tests: restrict the test cases allowed characters Most test cases in core and in extension only use `A-Za-z0-9-` but a few tests in extensions also have a `.` in their test cases names. Also add a `_` to allow all kind of case naming format. Differential Revision: https://phab.mercurial-scm.org/D3721
author Boris Feld <boris.feld@octobus.net>
date Tue, 12 Jun 2018 23:04:27 +0200
parents 47b9240615ca
children 296648321710
line wrap: on
line diff
--- a/tests/run-tests.py	Sat Jun 09 13:34:47 2018 +0900
+++ b/tests/run-tests.py	Tue Jun 12 23:04:27 2018 +0200
@@ -120,7 +120,7 @@
         }
 
     class TestRunnerLexer(lexer.RegexLexer):
-        testpattern = r'[\w-]+\.(t|py)(#[^\s]+)?'
+        testpattern = r'[\w-]+\.(t|py)(#[a-zA-Z0-9_\-\.]+)?'
         tokens = {
             'root': [
                 (r'^Skipped', token.Generic.Skipped, 'skipped'),
@@ -2646,7 +2646,7 @@
                 expanded_args.append(arg)
         args = expanded_args
 
-        testcasepattern = re.compile(br'([\w-]+\.t|py)(#([^\s]+))')
+        testcasepattern = re.compile(br'([\w-]+\.t|py)(#([a-zA-Z0-9_\-\.]+))')
         tests = []
         for t in args:
             case = None