summaryrefslogtreecommitdiff
path: root/ext/POSIX
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2010-02-17 20:43:46 +1100
committerJesse Luehrs <doy@tozt.net>2012-07-05 19:21:51 -0500
commita64f08cb65ac0431c7922879eb9bdae066e01035 (patch)
tree98fe042056bcd6c707a01916ff451c785a685777 /ext/POSIX
parent848bab4facdb0e4d55df87ebb5078741d248bb2b (diff)
downloadperl-a64f08cb65ac0431c7922879eb9bdae066e01035.tar.gz
rt #72232 - ignore wday/yday in mini_mktime as indirectly documented
Diffstat (limited to 'ext/POSIX')
-rw-r--r--ext/POSIX/t/posix.t17
1 files changed, 16 insertions, 1 deletions
diff --git a/ext/POSIX/t/posix.t b/ext/POSIX/t/posix.t
index 442b540dac..be804c24a2 100644
--- a/ext/POSIX/t/posix.t
+++ b/ext/POSIX/t/posix.t
@@ -8,7 +8,7 @@ BEGIN {
}
}
-use Test::More tests => 106;
+use Test::More tests => 109;
use POSIX qw(fcntl_h signal_h limits_h _exit getcwd open read strftime write
errno localeconv dup dup2 lseek access);
@@ -224,6 +224,21 @@ try_strftime("Mon Feb 28 00:00:00 2000 059", 0,0,0, 28,1,100);
try_strftime("Tue Feb 29 00:00:00 2000 060", 0,0,0, 0,2,100);
try_strftime("Wed Mar 01 00:00:00 2000 061", 0,0,0, 1,2,100);
try_strftime("Fri Mar 31 00:00:00 2000 091", 0,0,0, 31,2,100);
+
+{ # rt 72232
+
+ # Std C/POSIX allows day/month to be negative and requires that
+ # wday/yday be adjusted as needed
+ # previously mini_mktime() would allow yday to dominate if mday and
+ # month were both non-positive
+ # check that yday doesn't dominate
+ try_strftime("Thu Dec 30 00:00:00 1999 364", 0,0,0, -1,0,100);
+ try_strftime("Thu Dec 30 00:00:00 1999 364", 0,0,0, -1,0,100,-1,10);
+ # it would also allow a positive wday to override the calculated value
+ # check that wday is recalculated too
+ try_strftime("Thu Dec 30 00:00:00 1999 364", 0,0,0, -1,0,100,0,10);
+}
+
&POSIX::setlocale(&POSIX::LC_TIME, $lc) if $Config{d_setlocale};
{