Skip to content

Commit c183155

Browse files
committed
posix.t: Properly populate optional fields to strtime
The next commits that fix some bugs showed these were not properly getting initialized.
1 parent ce96f1e commit c183155

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

ext/POSIX/t/posix.t

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,12 @@ print POSIX::strftime("ok $test # %H:%M, on %m/%d/%y\n", localtime());
273273
# input fields to strftime().
274274
sub try_strftime {
275275
my $expect = shift;
276-
my $got = POSIX::strftime("%a %b %d %H:%M:%S %Y %j", @_);
276+
my @input = @_;
277+
278+
# Add zeros to missing parameters. The final 0 is for isdst, and the zero
279+
# forces use of mini_mktime (unless the code changes).
280+
push @input, 0 while @input < 9;
281+
my $got = POSIX::strftime("%a %b %d %H:%M:%S %Y %j", @input);
277282
is($got, $expect, "validating mini_mktime() and strftime(): $expect");
278283
}
279284

0 commit comments

Comments
 (0)