Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[6.d REVIEW] Add couple more later/earlier leap sec tests
Orig: 5e60103
  • Loading branch information
zoffixznet committed Dec 22, 2017
1 parent 0d78a13 commit 66d29b7
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion S32-temporal/DateTime.t
@@ -1,7 +1,7 @@
use v6;
use Test;

plan 283;
plan 285;

my $orwell = DateTime.new(year => 1984);

Expand Down Expand Up @@ -601,6 +601,14 @@ is DateTime.now.Date, Date.today, 'coercion to Date';
ds('2014-12-30T12:56:34Z'),
'subtracting 3 weeks, overflowing to years';

is ds('2008-12-31T23:59:60Z').earlier(day => 1),
ds('2008-12-30T23:59:59Z'),
'subtracting a day from a leap second clips';

is ds('2009-01-01T00:00:00Z').earlier(second => 1),
ds('2008-12-31T23:59:60Z'),
'subtracting a second from time can land on a leap second';

lives-ok {
ds('2010-01-31T12:56:34Z').later(month => 1);
}, '.later does not try to create an impossible datetime';
Expand Down

0 comments on commit 66d29b7

Please sign in to comment.