D1545: tests: fix regex in test-subrepo-git.t to match entire string
martinvonz (Martin von Zweigbergk)
phabricator at mercurial-scm.org
Wed Nov 29 14:21:26 EST 2017
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
Due to a bug in the test runner (fixed by the next commit), the regex
used for matching lines like " foobar | 2 +-" stoppped at the "|" and
the test passed even though the rest of the line did not match. The
test seems to have been supposed to match "|" and "+" literally on
those lines, so this changes the regex to escape those characters. It
also changes a "\s*" to "\s+" since I think we'll always include a
space after the "|" in the diffstat output.
diff --git a/tests/test-subrepo-git.t b/tests/test-subrepo-git.t
@@ -847,8 +847,8 @@
the output contains a regex, because git 1.7.10 and 1.7.11
change the amount of whitespace
$ hg diff --subrepos --stat
- \s*barfoo |\s*1 + (re)
- \s*foobar |\s*2 +- (re)
+ \s*barfoo \|\s+1 \+ (re)
+ \s*foobar \|\s+2 \+- (re)
2 files changed, 2 insertions\(\+\), 1 deletions?\(-\) (re)
adding an include should ignore the other elements
To: martinvonz, #hg-reviewers
More information about the Mercurial-devel