( )⚙ D1546 run-tests: make "| foo (re)" not match everything

This is an archive of the discontinued Mercurial Phabricator instance.

run-tests: make "| foo (re)" not match everything
ClosedPublic

Authored by martinvonz on Nov 29 2017, 2:21 PM.

Details

Summary

We make "foo (re)" match the entire line by adding a \Z to the regular
expression before matching. However, that doesn't help when the
regular expression is something like "| foo", because that gets
translated to "| foo\Z", where the "|" has lower precedence and it
thus matches the empty string, which is of course a prefix of every
string. Fix by wrapping expression in a group before adding the \Z to
the end.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

martinvonz created this revision.Nov 29 2017, 2:21 PM
quark accepted this revision.Nov 29 2017, 2:43 PM
yuja accepted this revision.Nov 30 2017, 7:42 AM
This revision is now accepted and ready to land.Nov 30 2017, 7:42 AM
This revision was automatically updated to reflect the committed changes.