Skip to content

Commit

Permalink
Add/improve .in-timezone tests
Browse files Browse the repository at this point in the history
- Cover Rat/Str values R#2381
    rakudo/rakudo#2381
- Unfudge leapsecond tests and remove values that are non-divisible
    by 60. R#2097 rakudo/rakudo#2097
  • Loading branch information
zoffixznet committed Oct 17, 2018
1 parent 383ca21 commit 529e4e0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions S32-temporal/DateTime.t
Expand Up @@ -812,13 +812,16 @@ subtest 'synthetics not allowed in date formats' => {
subtest 'can parse leap second in non-UTC timezones' => {
my \h := 3600;
plan +my @tzs = flat (
10000, 100*h, 30*h, 24*h, 12*h, 3*h, 0, .5*h, 123, 432, 1
100*h, 30*h, 24*h, 12*h, 3*h, 0,

# https://github.com/rakudo/rakudo/issues/2381
.5*h, 9.25*h, 5.45*h, '7200',
).map: {-$_, $_}

my \utc := DateTime.new: '2016-12-31T23:59:60Z';
for @tzs {
#?rakudo skip 'Cannot parse leap on non-23:59'
cmp-ok $d, '==', utc, "parsed correct date for .in-timezone($_)";
cmp-ok utc.in-timezone($_), '==', utc,
"parsed correct date for .in-timezone($_)";
}
}

Expand Down

0 comments on commit 529e4e0

Please sign in to comment.