Skip to content

Commit

Permalink
[decodelocaltime] Make test less sensitivve to timezone
Browse files Browse the repository at this point in the history
Silly me, thinking the unix epoch starts at 1970-01-01 00:00:00,
forgetting about timezones :-)
  • Loading branch information
bdw committed Sep 15, 2018
1 parent a7351c4 commit d46ad39
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion t/moar/12-decodelocaltime.t
Expand Up @@ -5,7 +5,9 @@ plan(2);
my @a := nqp::decodelocaltime(nqp::time_i());
ok(9 == nqp::elems(@a));
my @b := nqp::decodelocaltime(0);
ok(1970 == nqp::atpos_i(@b, 5));
my $year := nqp::atpos_i(@b, 5);

ok($year == 1970 || $year == 1969); # timezone offset

#dies-ok({ nqp::decodelocaltime(nqp::bitshiftl_i(1,63)); },
# "decode localtime overflow");

0 comments on commit d46ad39

Please sign in to comment.