Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
mercurial-devel
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mercurial
mercurial-devel
Commits
6f59154fb604
Commit
6f59154fb604
authored
14 years ago
by
Nicolas Dumazet
Browse files
Options
Downloads
Patches
Plain Diff
tests: catch re.error if test line is not a valid regular expression
parent
3cdd6fdc3d9e
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/run-tests.py
+8
-1
8 additions, 1 deletion
tests/run-tests.py
with
8 additions
and
1 deletion
tests/run-tests.py
+
8
−
1
View file @
6f59154f
...
...
@@ -499,6 +499,13 @@
finally
:
os
.
remove
(
name
)
def
rematch
(
el
,
l
):
try
:
return
re
.
match
(
el
,
l
)
except
re
.
error
:
# el is an invalid regex
return
False
pos
=
-
1
postout
=
[]
for
n
,
l
in
enumerate
(
output
):
...
...
@@ -513,7 +520,7 @@
if
el
==
l
:
# perfect match (fast)
postout
.
append
(
"
"
+
l
)
elif
el
and
re
.
match
(
el
,
l
):
# fallback regex match
elif
el
and
rematch
(
el
,
l
):
# fallback regex match
postout
.
append
(
"
"
+
el
)
else
:
# mismatch - let diff deal with it
postout
.
append
(
"
"
+
l
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment