Patchwork D3252: tests: use `f --newer` instead of `stat -c` in test-fix.t

login
register
mail settings
Submitter phabricator
Date April 12, 2018, 3:39 p.m.
Message ID <9385f97c85ff399dd9a0959a416cb4a2@localhost.localdomain>
Download mbox | patch
Permalink /patch/30803/
State Not Applicable
Headers show

Comments

phabricator - April 12, 2018, 3:39 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG314f39e5fa86: tests: use `f --newer` instead of `stat -c` in test-fix.t (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3252?vs=8018&id=8071

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

AFFECTED FILES
  tests/test-fix.t

CHANGE DETAILS




To: durin42, #hg-reviewers, indygreg
Cc: mercurial-devel

Patch

diff --git a/tests/test-fix.t b/tests/test-fix.t
--- a/tests/test-fix.t
+++ b/tests/test-fix.t
@@ -492,11 +492,11 @@ 
   $ printf "NO FIX NEEDED\n" > foo.whole
   $ hg add
   adding foo.whole
-  $ OLD_MTIME=`stat -c %Y foo.whole`
-  $ sleep 1 # mtime has a resolution of one second.
+  $ cp foo.whole foo.whole.orig
+  $ sleep 2 # mtime has a resolution of one or two seconds.
   $ hg fix --working-dir
-  $ NEW_MTIME=`stat -c %Y foo.whole`
-  $ test $OLD_MTIME = $NEW_MTIME
+  $ f foo.whole --newer foo.whole.orig
+  foo.whole: older than foo.whole.orig
 
   $ cd ..