Mercurial > hg-stable
changeset 37798:8fa3396a832d stable
test-fix: fix use of 'f --newer' to check that foo.whole is not updated
Here we want to assert not 'mtime(foo.whole.orig) < mtime(foo.whole)'.
The condition has to be inverted since 'f --newer' says "newer" if the
mtimes match.
Alternatively, we could insert 'sleep 2' before 'cp' to ensure that
foo.whole.orig is newer than foo.whole, but a fewer sleeps should be
better.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Thu, 19 Apr 2018 22:12:10 +0900 |
parents | 43221a57e22f |
children | 1770d8b3e554 |
files | tests/test-fix.t |
diffstat | 1 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/test-fix.t Thu Apr 19 19:55:51 2018 +0900 +++ b/tests/test-fix.t Thu Apr 19 22:12:10 2018 +0900 @@ -493,11 +493,11 @@ $ printf "NO FIX NEEDED\n" > foo.whole $ hg add adding foo.whole - $ cp foo.whole foo.whole.orig + $ cp -p foo.whole foo.whole.orig $ sleep 2 # mtime has a resolution of one or two seconds. $ hg fix --working-dir - $ f foo.whole --newer foo.whole.orig - foo.whole: older than foo.whole.orig + $ f foo.whole.orig --newer foo.whole + foo.whole.orig: newer than foo.whole $ cd ..