Skip to content

Commit

Permalink
POSIX/t/time.t: Remove no longer necessary code
Browse files Browse the repository at this point in the history
POSIX::strftime() now automatically handles the case where the locales of
LC_TIME and LC_CTYPE aren't the same.  So no need to explicitly do this
in the test file.
  • Loading branch information
khwilliamson committed May 7, 2023
1 parent 2623aa9 commit 255b8d2
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions ext/POSIX/t/time.t
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,6 @@ if (locales_enabled('LC_TIME')) {
$orig_time_loc = setlocale(LC_TIME) || die "Cannot get time locale information: $!";
setlocale(LC_TIME, "C") || die "Cannot setlocale() to C: $!";
}
if (locales_enabled('LC_CTYPE')) {
$orig_ctype_loc = setlocale(LC_CTYPE) || die "Cannot get ctype locale information: $!";
setlocale(LC_CTYPE, "C") || die "Cannot setlocale() to C: $!";
}
my $jan_16 = 15 * 86400;
is(ctime($jan_16), strftime("%a %b %d %H:%M:%S %Y\n", CORE::localtime($jan_16)),
"get ctime() equal to strftime()");
Expand Down Expand Up @@ -101,9 +97,6 @@ SKIP: {
if (locales_enabled('LC_TIME')) {
setlocale(LC_TIME, $orig_time_loc) || die "Cannot setlocale(LC_TIME) back to orig: $!";
}
if (locales_enabled('LC_CTYPE')) {
setlocale(LC_CTYPE, $orig_ctype_loc) || die "Cannot setlocale(LC_CTYPE) back to orig: $!";
}

# clock() seems to have different definitions of what it does between POSIX
# and BSD. Cygwin, Win32, and Linux lean the BSD way. So, the tests just
Expand Down

0 comments on commit 255b8d2

Please sign in to comment.