From: Steve Peters Date: Sat, 17 Dec 2005 04:03:05 +0000 (+0000) Subject: Fix for ext/POSIX/t/time.t so the strftime() test works on systems X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=018eeb1214fceb5fc2491b2c0cf4420b79b385ad;p=p5sagit%2Fp5-mst-13.2.git Fix for ext/POSIX/t/time.t so the strftime() test works on systems that aren't quite up to SUS3. Based on a patch by David Dyck in RT #37960: POSIX/t/time fails bleadperl p4raw-id: //depot/perl@26384 --- diff --git a/ext/POSIX/t/time.t b/ext/POSIX/t/time.t index 33bb556..c09a375 100644 --- a/ext/POSIX/t/time.t +++ b/ext/POSIX/t/time.t @@ -36,13 +36,9 @@ is(asctime(localtime(12345678)), ctime(12345678), "asctime() and ctime() at 1234 # Careful! strftime() is locale sensative. Let's take care of that my $orig_loc = setlocale(LC_TIME, "C") || die "Cannot setlocale() to C: $!"; -if ($^O eq "MSWin32") { - is(ctime(0), strftime("%a %b %d %H:%M:%S %Y\n", localtime(0)), +my $jan_16 = 15 * 86400; +is(ctime($jan_16), strftime("%a %b %d %H:%M:%S %Y\n", localtime($jan_16)), "get ctime() equal to strftime()"); -} else { - is(ctime(0), strftime("%a %b %e %H:%M:%S %Y\n", localtime(0)), - "get ctime() equal to strftime()"); -} setlocale(LC_TIME, $orig_loc) || die "Cannot setlocale() back to orig: $!"; # clock() seems to have different definitions of what it does between POSIX