comparison tests/test-command-template.t @ 18199:24f5bec1601f stable

test-command-template.t: fix test so it all year This test started failing for me after midnight UTC on December 31st. Fixed it by specifying a date 7 years in the future more precisely (rather than just adding 8 to the year and specifying January 1st), which allows the test to pass both now and on 2012-12-01 at the same time.
author Augie Fackler <raf@durin42.com>
date Mon, 31 Dec 2012 21:50:35 -0600
parents 0b241d7a8c62
children 3b1005354440
comparison
equal deleted inserted replaced
18198:9b4adaef0db9 18199:24f5bec1601f
1346 1346
1347 $ hg log --template '{date|age}\n' > /dev/null || exit 1 1347 $ hg log --template '{date|age}\n' > /dev/null || exit 1
1348 1348
1349 >>> from datetime import datetime 1349 >>> from datetime import datetime
1350 >>> fp = open('a', 'w') 1350 >>> fp = open('a', 'w')
1351 >>> fp.write(str(datetime.now().year + 8) + '-01-01 00:00') 1351 >>> n = datetime.now()
1352 >>> fp.write('%d-%d-%d 00:00' % ((n.year + 7), n.month, n.day))
1352 >>> fp.close() 1353 >>> fp.close()
1353 $ hg add a 1354 $ hg add a
1354 $ hg commit -m future -d "`cat a`" 1355 $ hg commit -m future -d "`cat a`"
1355 1356
1356 $ hg log -l1 --template '{date|age}\n' 1357 $ hg log -l1 --template '{date|age}\n'