tests: allow more flexibility in git diffstat output
authorMathias De Maré <mathias.demare@gmail.com>
Sat, 13 Dec 2014 09:45:00 +0100
changeset 23542 8b5adc6b72ae
parent 23541 495bc1b65d25
child 23543 4dd8a6a1240d
tests: allow more flexibility in git diffstat output The output of 'git diff --stat' changed in git 1.7.10 and 1.7.11. To ensure the tests work with earlier versions of git as well, the output is now wrapped with a whitespace regex.
tests/test-subrepo-git.t
--- a/tests/test-subrepo-git.t	Thu Dec 11 21:21:21 2014 -0800
+++ b/tests/test-subrepo-git.t	Sat Dec 13 09:45:00 2014 +0100
@@ -772,9 +772,12 @@
    foo
    bar (no-eol)
 
+execute a diffstat
+the output contains a regex, because git 1.7.10 and 1.7.11
+ change the amount of whitespace
   $ hg diff --subrepos --stat
-  barfoo | 1 +
-   foobar | 2 +-
+  \s*barfoo |\s*1 + (re)
+  \s*foobar |\s*2 +- (re)
    2 files changed, 2 insertions(+), 1 deletion(-) (no-eol)
 
 ensure adding include/exclude ignores the subrepo