[Updated] D8542: grep: improve test coverage

valentin.gatienbaron (Valentin Gatien-Baron) phabricator at mercurial-scm.org
Mon May 18 17:10:51 UTC 2020


Closed by commit rHG7e7080ab8ba8: grep: improve test coverage (authored by valentin.gatienbaron).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8542?vs=21406&id=21420

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8542/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8542

AFFECTED FILES
  tests/test-grep.t

CHANGE DETAILS

diff --git a/tests/test-grep.t b/tests/test-grep.t
--- a/tests/test-grep.t
+++ b/tests/test-grep.t
@@ -645,18 +645,24 @@
   $ hg init sng
   $ cd sng
   $ echo "unmod" >> um
-  $ hg ci -A -m "adds unmod to um"
-  adding um
+  $ echo old > old
+  $ hg ci -q -A -m "adds unmod to um"
   $ echo "something else" >> new
   $ hg ci -A -m "second commit"
   adding new
   $ hg grep -r "." "unmod"
   um:1:unmod
 
-Working directory is searched by default
+Existing tracked files in the working directory are searched by default
 
   $ echo modified >> new
-  $ hg grep mod
+  $ echo 'added' > added; hg add added
+  $ echo 'added, missing' > added-missing; hg add added-missing; rm added-missing
+  $ echo 'untracked' > untracked
+  $ hg rm old
+  $ hg grep '[^Z]'
+  added:added
+  new:something else
   new:modified
   um:unmod
 
@@ -670,17 +676,6 @@
 
   $ cd ..
 
-Fix_Wdir(): test that passing wdir() t -r flag does greps on the
-files modified in the working directory
-
-  $ cd a
-  $ echo "abracadara" >> a
-  $ hg add a
-  $ hg grep -r "wdir()" "abra"
-  a:2147483647:abracadara
-
-  $ cd ..
-
 Change Default of grep by ui.tweakdefaults, that is, the files not in current
 working directory should not be grepp-ed on
 



To: valentin.gatienbaron, #hg-reviewers
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20200518/7749adf3/attachment-0002.html>


More information about the Mercurial-patches mailing list