HEX
Server: Apache
System: Linux server-674799.igrow.ws 5.14.0-611.30.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Feb 11 06:42:00 EST 2026 x86_64
User: elrashedytravel (1025)
PHP: 8.1.34
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/.cpan/build/Test-Warnings-0.033-0/t/07-no_plan.t
use strict;
use warnings;

# we intended to insert a test at END time whenever:
# - done_testing has not been run,
# - AND ':no_end_test' is not imported,
# - AND EITHER at least one test has been run, OR there was a plan.

# before v0.003, these last two conditions were also ANDed, so we
# never got a test added when we were running tests without a plan
# and terminated without done_testing (such as terminating a forked
# process).

use Test::More 'no_plan';

# define our END block first, so it is run last (after TW's END)
END {
    final_tests();
}

use Test::Warnings;

pass('this is a passing test');

# now we "END"...

sub final_tests
{
    is(
        Test::Builder->new->current_test, 2,
        'two tests have been run (the pass, and our no-warnings-via-END test)',
    );
}