Bug 5549 : Koha::Calendar::addDate should not loop on -1
[koha.git] / t / Kalendar.t
index ef80ca9..f955231 100755 (executable)
@@ -5,7 +5,7 @@ use DateTime;
 use DateTime::TimeZone;
 
 use C4::Context;
-use Test::More tests => 8;    # last test to print
+use Test::More tests => 9;
 
 BEGIN { use_ok('Koha::Calendar'); }
 
@@ -57,3 +57,6 @@ is( $cal->is_holiday($notspecial), 0, 'open day test' );
 
 my $dt = $cal->addDate( $saturday, 1, 'days' );
 is( $dt->day_of_week, 1, 'addDate skips closed Sunday' );
+
+$dt = $cal->addDate( $bloomsday, -1 );
+cmp_ok( $dt->ymd(), 'cmp', '2011-06-15', 'Negative call to addDate' );