Skip to content

Commit fcd087f

Browse files
committed
unTODO test in GH 21827 TODO tests
This commit restructures the TODO tests for GH 21827 so that the test that passes is not marked as TODO while the failing tests still are. warnings_like() had to be swapped out for capture_warnings() with manual testing so that we could have granular control over the tests, as we did not have such granular control with the three tests that were originally generated by warnings_like().
1 parent e96b722 commit fcd087f

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

t/run/todo.t

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -387,11 +387,14 @@ TODO: {
387387
TODO: {
388388
local $::TODO = 'GH 21827';
389389
my $test = 18446744073709550592;
390-
warnings_like(
391-
sub { localtime $test },
392-
[ (qr/localtime\($test\)/) x 2 ],
393-
'localtime() warning reports correct value when given too large of a number; GH 21827'
394-
);
390+
my @warnings = capture_warnings(sub { localtime $test });
391+
{
392+
local $::TODO = 0;
393+
is(scalar @warnings, 2, 'Correct number of warnings captured; GH 21827');
394+
}
395+
for my $w (@warnings) {
396+
like($w, qr/localtime\($test\)/, 'localtime() warnings reports correct value when given too large of a number; GH 21827');
397+
}
395398
}
396399

397400
TODO: {

0 commit comments

Comments
 (0)