[Request] [+- ] D8542: grep: improve test coverage
valentin.gatienbaron (Valentin Gatien-Baron)
phabricator at mercurial-scm.org
Sun May 17 17:49:12 UTC 2020
valentin.gatienbaron created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.
REPOSITORY
rHG Mercurial
BRANCH
default
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, mercurial-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mercurial-scm.org/pipermail/mercurial-patches/attachments/20200517/1ef63a53/attachment.html>
More information about the Mercurial-patches
mailing list