From d6251142a2bae5de4f861a4ed2696eac8469cf8d Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 4 Apr 2010 10:00:01 -0400 Subject: [PATCH] Unit Tests - Fixed unit tests that broke because the unit test script took more than one second to run. Ordinarily is a test script does this: $ task add foo $ task list Then the age of the task is listed as '-', which means under one second. But if the test does this: $ task add foo $ sleep 1 $ task list Then the age is listed as '1 sec'. Sometimes, as in these tests, the host may be just slow enough that the test script expects '-', but gets '1 sec'. --- src/tests/bug.annual.t | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/tests/bug.annual.t b/src/tests/bug.annual.t index 4ccd41f19..659b8d5e4 100755 --- a/src/tests/bug.annual.t +++ b/src/tests/bug.annual.t @@ -57,16 +57,16 @@ if (open my $fh, '>', 'annual.rc') qx{../task rc:annual.rc add foo due:1/1/2000 recur:annual until:1/1/2009}; my $output = qx{../task rc:annual.rc list}; -like ($output, qr/2\s+1\/1\/2000\s+-\s+foo/, 'synthetic 1 no creep'); -like ($output, qr/3\s+1\/1\/2001\s+-\s+foo/, 'synthetic 2 no creep'); -like ($output, qr/4\s+1\/1\/2002\s+-\s+foo/, 'synthetic 3 no creep'); -like ($output, qr/5\s+1\/1\/2003\s+-\s+foo/, 'synthetic 4 no creep'); -like ($output, qr/6\s+1\/1\/2004\s+-\s+foo/, 'synthetic 5 no creep'); -like ($output, qr/7\s+1\/1\/2005\s+-\s+foo/, 'synthetic 6 no creep'); -like ($output, qr/8\s+1\/1\/2006\s+-\s+foo/, 'synthetic 7 no creep'); -like ($output, qr/9\s+1\/1\/2007\s+-\s+foo/, 'synthetic 8 no creep'); -like ($output, qr/10\s+1\/1\/2008\s+-\s+foo/, 'synthetic 9 no creep'); -like ($output, qr/11\s+1\/1\/2009\s+-\s+foo/, 'synthetic 10 no creep'); +like ($output, qr/2\s+1\/1\/2000\s+(?:-|\d+\ssecs?)\s+foo/, 'synthetic 1 no creep'); +like ($output, qr/3\s+1\/1\/2001\s+(?:-|\d+\ssecs?)\s+foo/, 'synthetic 2 no creep'); +like ($output, qr/4\s+1\/1\/2002\s+(?:-|\d+\ssecs?)\s+foo/, 'synthetic 3 no creep'); +like ($output, qr/5\s+1\/1\/2003\s+(?:-|\d+\ssecs?)\s+foo/, 'synthetic 4 no creep'); +like ($output, qr/6\s+1\/1\/2004\s+(?:-|\d+\ssecs?)\s+foo/, 'synthetic 5 no creep'); +like ($output, qr/7\s+1\/1\/2005\s+(?:-|\d+\ssecs?)\s+foo/, 'synthetic 6 no creep'); +like ($output, qr/8\s+1\/1\/2006\s+(?:-|\d+\ssecs?)\s+foo/, 'synthetic 7 no creep'); +like ($output, qr/9\s+1\/1\/2007\s+(?:-|\d+\ssecs?)\s+foo/, 'synthetic 8 no creep'); +like ($output, qr/10\s+1\/1\/2008\s+(?:-|\d+\ssecs?)\s+foo/, 'synthetic 9 no creep'); +like ($output, qr/11\s+1\/1\/2009\s+(?:-|\d+\ssecs?)\s+foo/, 'synthetic 10 no creep'); # Cleanup. unlink 'pending.data';