Skip to content

Commit

Permalink
Merge pull request #1 from jmaslak/main
Browse files Browse the repository at this point in the history
Tests should pass on Jan 1, 2023

Test also added for January 1, 2024 gmtime to prevent regression.

Because day in year starts at zero, last possible day in year is 365
  • Loading branch information
lizmat committed Jan 1, 2024
2 parents 111853d + a87ce4c commit 69f2e65
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions t/01-basic.rakutest
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use Test;
use P5localtime;

plan 42;
plan 51;

ok defined(::('&localtime')), 'is &localtime imported?';
ok defined(::('&gmtime')), 'is &gmtime imported?';
Expand All @@ -14,7 +14,7 @@ sub ok-list-time(@t, $type, \dst) {
ok 0 <= @t[4] <= 11, "is $type month in range";
ok 0 <= @t[5] , "is $type year in range";
ok 0 <= @t[6] <= 6, "is $type day in week in range";
ok 1 <= @t[7] <= 366, "is $type day in year in range";
ok 0 <= @t[7] <= 365, "is $type day in year in range";
ok 0 <= @t[8] <= dst, "is $type is daylight saving time in range";
}

Expand All @@ -23,6 +23,7 @@ ok-list-time gmtime, 'gmtime', 0;

ok-list-time localtime(1525034924), 'localtime(1525034924)', 1;
ok-list-time gmtime(1525034924), 'gmtime(1525034924)', 0;
ok-list-time gmtime(1704135816), 'gmtime(1704135816)', 0;

sub ok-scalar-time($t, $type) {
dd $t unless
Expand Down

0 comments on commit 69f2e65

Please sign in to comment.