HEX
Server: Apache
System: Linux nc-ph-4101.simplemoneygoals.com 5.14.0-503.21.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Sun Jan 12 09:45:05 EST 2025 x86_64
User: dailygoldindex (1004)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/share/doc/perl-Test-Simple/t/regression/812-todo.t
use strict;
use warnings;

use Test2::API qw/intercept/;
use Test::More;

my @values = (
    0,                # false but defined -> inconsistent
    0.0,              # false but defined -> inconsistent
    "0.0",            # true -> TODO
    "this is why",    # as expected
);

for my $value (@values) {
    local $TODO = $value;
    my $x = defined($value) ? "\"$value\"" : 'UNDEF';
    fail "Testing: $x";
}

my $e = intercept {
    local $TODO = "";
    fail "Testing: '\"\"'";
};

ok(!$e->[0]->effective_pass, "Test was not TODO when set to \"\"");
like($e->[1]->message, qr/Failed test '/, "Did not add TODO to the diagnostics");

done_testing;