From 8d8f7ddb40b4b603449e0b84a230220a0fa45f2a Mon Sep 17 00:00:00 2001 From: Federico Hernandez Date: Fri, 1 Jan 2010 22:11:10 +0100 Subject: [PATCH] Fixed 2 unit tests that behaved wrong at the end/beginning of a year. --- src/tests/bug.327.t | 2 +- src/tests/cal.t | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/tests/bug.327.t b/src/tests/bug.327.t index de8340e0a..7c66a15bc 100755 --- a/src/tests/bug.327.t +++ b/src/tests/bug.327.t @@ -47,7 +47,7 @@ qx{../task rc:bug.rc 2 due:}; # Result: Somehow the due date is incremented and wraps around to 12/31/1969, # then keeps going back to today. my $output = qx{../task rc:bug.rc li}; -like ($output, qr/^1 task$/ms, 'Should only be one task'); +unlike ($output, qr/1969/ms, 'Should not display 12/31/1969'); # Cleanup. unlink 'pending.data'; diff --git a/src/tests/cal.t b/src/tests/cal.t index 78b081ec2..3238011f2 100755 --- a/src/tests/cal.t +++ b/src/tests/cal.t @@ -68,7 +68,15 @@ $output = qx{../task rc:cal.rc rc.weekstart:Monday cal}; like ($output, qr/Fr Sa Su/, 'Week starts on Monday'); $output = qx{../task rc:cal.rc cal y}; like ($output, qr/$month\w+?\s+?$year/, 'Current month and year are displayed'); +if ( $month eq "Jan") +{ + $nextyear = $nextyear - 1; +} like ($output, qr/$prevmonth\w+?\s+?$nextyear/, 'Month and year one year ahead are displayed'); +if ( $month eq "Jan") +{ + $nextyear = $nextyear + 1; +} unlike ($output, qr/$month\w+?\s+?$nextyear/, 'Current month and year ahead are not displayed'); # task cal due and task cal due y