From a7b20b7a4e507f62c0aa73107b44930269803bb2 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Mon, 31 Dec 2012 10:07:48 -0500 Subject: [PATCH] Unit Tests - Fixed some tests so they no longer fail at EOM, by using "30d" to project into the future, instead of just "eom". - The count.t test script has 4 tests still failing at EOM, but warnings are now emitted until we figure out how to improve them. - Added a test to bug.1110.t. --- test/bug.1110.t | 5 ++++- test/count.t | 4 ++++ test/overdue.t | 2 +- test/urgency.t | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/test/bug.1110.t b/test/bug.1110.t index eb217eb91..4030c888b 100755 --- a/test/bug.1110.t +++ b/test/bug.1110.t @@ -28,7 +28,7 @@ use strict; use warnings; -use Test::More tests => 3; +use Test::More tests => 4; # Create the rc file. if (open my $fh, '>', 'bug.rc') @@ -45,6 +45,9 @@ qx{../src/task rc:bug.rc 1 done 2>&1}; my $output = qx{../src/task all status:Completed rc:bug.rc 2>&1}; like ($output, qr/ToBeCompleted/, 'status:Completed returns completed tasks'); +$output = qx{../src/task all status:completed rc:bug.rc 2>&1}; +like ($output, qr/ToBeCompleted/, 'status:completed returns completed tasks'); + # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); ok (! -r 'pending.data' && diff --git a/test/count.t b/test/count.t index a2f4bc312..208ce3179 100755 --- a/test/count.t +++ b/test/count.t @@ -52,18 +52,22 @@ qx{../src/task rc:count.rc add four wait:eom 2>&1}; # expanding to 2012-04-30 24:00:00, as per ISO-8601. qx{../src/task rc:count.rc add five due:eom recur:monthly 2>&1}; +diag ("Problem: the next test fails at EOM"); my $output = qx{../src/task rc:count.rc count 2>&1}; like ($output, qr/^5\n/ms, 'count'); $output = qx{../src/task rc:count.rc count status:deleted rc.debug:1 2>&1}; like ($output, qr/^1\n/ms, 'count status:deleted'); +diag ("Problem: the next test fails at EOM"); $output = qx{../src/task rc:count.rc count e 2>&1}; like ($output, qr/^3\n/ms, 'count e'); +diag ("Problem: the next test fails at EOM"); $output = qx{../src/task rc:count.rc count description.startswith:f 2>&1}; like ($output, qr/^2\n/ms, 'count description.startswith:f'); +diag ("Problem: the next test fails at EOM"); $output = qx{../src/task rc:count.rc count due.any: 2>&1}; like ($output, qr/^1\n/ms, 'count due.any:'); diff --git a/test/overdue.t b/test/overdue.t index 85c2274ba..cbfcc57c3 100755 --- a/test/overdue.t +++ b/test/overdue.t @@ -43,7 +43,7 @@ if (open my $fh, '>', 'due.rc') # should list only the one task. qx{../src/task rc:due.rc add due:yesterday one 2>&1}; qx{../src/task rc:due.rc add due:tomorrow two 2>&1}; -qx{../src/task rc:due.rc add due:eoy three 2>&1}; +qx{../src/task rc:due.rc add due:30d three 2>&1}; my $output = qx{../src/task rc:due.rc overdue 2>&1}; like ($output, qr/one/, 'overdue: task 1 shows up'); unlike ($output, qr/two/, 'overdue: task 2 does not show up'); diff --git a/test/urgency.t b/test/urgency.t index 8b85e140a..c5017a02f 100755 --- a/test/urgency.t +++ b/test/urgency.t @@ -301,7 +301,7 @@ $output = qx{../src/task rc:urgency.rc 43 _urgency 2>&1}; like ($output, qr/urgency 18$/ms, '+TAG = 18'); # scheduled 0 (scheduled future) -qx {../src/task rc:urgency.rc add 12a scheduled:eom 2>&1}; +qx {../src/task rc:urgency.rc add 12a scheduled:30d 2>&1}; $output = qx{../src/task rc:urgency.rc 44 _urgency 2>&1}; like ($output, qr/urgency 0$/ms, 'scheduled future = 0');