test-walk: add more tests for -I/-X
authorMartin von Zweigbergk <martinvonz@google.com>
Wed, 05 Nov 2014 11:25:57 -0800
changeset 25217 70e822796ac8
parent 25216 dc562165044a
child 25220 f0fbd88b21fb
test-walk: add more tests for -I/-X We had very limited testing of -I and -X, especially when combined with plain file patterns and with each other. This adds some more protection against regressions as upcoming patches modify the matcher code. (Originally meant for my own upcoming patches, but now I know drgott will be sending some patches soon.) The only noteworthy cases seems to be that both of hg debugwalk -Xbeans/black beans/black hg debugwalk -Xbeans beans/black walk the file. I would personally have expected the -X to trump. I don't care enough to change it, but I also think it's fair if some future commit changes the behavior.
tests/test-walk.t
--- a/tests/test-walk.t	Sat May 16 16:06:22 2015 -0700
+++ b/tests/test-walk.t	Wed Nov 05 11:25:57 2014 -0800
@@ -170,6 +170,32 @@
   f  beans/black    beans/black
   f  fenugreek      fenugreek
   f  mammals/skunk  mammals/skunk
+  $ hg debugwalk -Ibeans mammals
+  $ hg debugwalk -Inon-existent
+  $ hg debugwalk -Inon-existent -Ibeans/black
+  f  beans/black  beans/black
+  $ hg debugwalk -Ibeans beans/black
+  f  beans/black  beans/black  exact
+  $ hg debugwalk -Ibeans/black beans
+  f  beans/black  beans/black
+  $ hg debugwalk -Xbeans/black beans
+  f  beans/borlotti  beans/borlotti
+  f  beans/kidney    beans/kidney
+  f  beans/navy      beans/navy
+  f  beans/pinto     beans/pinto
+  f  beans/turtle    beans/turtle
+  $ hg debugwalk -Xbeans/black -Ibeans
+  f  beans/borlotti  beans/borlotti
+  f  beans/kidney    beans/kidney
+  f  beans/navy      beans/navy
+  f  beans/pinto     beans/pinto
+  f  beans/turtle    beans/turtle
+  $ hg debugwalk -Xbeans/black beans/black
+  f  beans/black  beans/black  exact
+  $ hg debugwalk -Xbeans/black -Ibeans/black
+  $ hg debugwalk -Xbeans beans/black
+  f  beans/black  beans/black  exact
+  $ hg debugwalk -Xbeans -Ibeans/black
   $ hg debugwalk 'glob:mammals/../beans/b*'
   f  beans/black     beans/black
   f  beans/borlotti  beans/borlotti