diff options
Diffstat (limited to 'ext/XS/APItest/t/xs_special_subs_require.t')
-rw-r--r-- | ext/XS/APItest/t/xs_special_subs_require.t | 58 |
1 files changed, 37 insertions, 21 deletions
diff --git a/ext/XS/APItest/t/xs_special_subs_require.t b/ext/XS/APItest/t/xs_special_subs_require.t index b868f33d91..af957be1e2 100644 --- a/ext/XS/APItest/t/xs_special_subs_require.t +++ b/ext/XS/APItest/t/xs_special_subs_require.t @@ -15,7 +15,11 @@ BEGIN { use strict; use warnings; -use Test::More tests => 103; +my $uc; +BEGIN { + $uc = $] > 5.009; +} +use Test::More tests => $uc ? 103 : 83; # Doing this longhand cut&paste makes it clear # BEGIN and INIT are FIFO, CHECK and END are LIFO @@ -23,8 +27,10 @@ BEGIN { print "# First BEGIN\n"; is($XS::APItest::BEGIN_called, undef, "BEGIN not yet called"); is($XS::APItest::BEGIN_called_PP, undef, "BEGIN not yet called"); - is($XS::APItest::UNITCHECK_called, undef, "UNITCHECK not yet called"); - is($XS::APItest::UNITCHECK_called_PP, undef, "UNITCHECK not called"); + is($XS::APItest::UNITCHECK_called, undef, "UNITCHECK not yet called") + if $uc; + is($XS::APItest::UNITCHECK_called_PP, undef, "UNITCHECK not called") + if $uc; is($XS::APItest::CHECK_called, undef, "CHECK not called"); is($XS::APItest::CHECK_called_PP, undef, "CHECK not called"); is($XS::APItest::INIT_called, undef, "INIT not called"); @@ -37,8 +43,10 @@ CHECK { print "# First CHECK\n"; is($XS::APItest::BEGIN_called, undef, "BEGIN not yet called"); is($XS::APItest::BEGIN_called_PP, undef, "BEGIN not yet called"); - is($XS::APItest::UNITCHECK_called, undef, "UNITCHECK not yet called"); - is($XS::APItest::UNITCHECK_called_PP, undef, "UNITCHECK not called"); + is($XS::APItest::UNITCHECK_called, undef, "UNITCHECK not yet called") + if $uc; + is($XS::APItest::UNITCHECK_called_PP, undef, "UNITCHECK not called") + if $uc; is($XS::APItest::CHECK_called, undef, "CHECK not called (too late)"); is($XS::APItest::CHECK_called_PP, undef, "CHECK not called (too late)"); is($XS::APItest::INIT_called, undef, "INIT not called"); @@ -51,8 +59,10 @@ INIT { print "# First INIT\n"; is($XS::APItest::BEGIN_called, undef, "BEGIN not yet called"); is($XS::APItest::BEGIN_called_PP, undef, "BEGIN not yet called"); - is($XS::APItest::UNITCHECK_called, undef, "UNITCHECK not yet called"); - is($XS::APItest::UNITCHECK_called_PP, undef, "UNITCHECK not called"); + is($XS::APItest::UNITCHECK_called, undef, "UNITCHECK not yet called") + if $uc; + is($XS::APItest::UNITCHECK_called_PP, undef, "UNITCHECK not called") + if $uc; is($XS::APItest::CHECK_called, undef, "CHECK not called (too late)"); is($XS::APItest::CHECK_called_PP, undef, "CHECK not called (too late)"); is($XS::APItest::INIT_called, undef, "INIT not called"); @@ -65,8 +75,8 @@ END { print "# First END\n"; is($XS::APItest::BEGIN_called, 1, "BEGIN called"); is($XS::APItest::BEGIN_called_PP, 1, "BEGIN called"); - is($XS::APItest::UNITCHECK_called, 1, "UNITCHECK called"); - is($XS::APItest::UNITCHECK_called_PP, 1, "UNITCHECK called"); + is($XS::APItest::UNITCHECK_called, 1, "UNITCHECK called") if $uc; + is($XS::APItest::UNITCHECK_called_PP, 1, "UNITCHECK called") if $uc; is($XS::APItest::CHECK_called, undef, "CHECK not called (too late)"); is($XS::APItest::CHECK_called_PP, undef, "CHECK not called (too late)"); is($XS::APItest::INIT_called, undef, "INIT not called (too late)"); @@ -78,8 +88,8 @@ END { print "# First body\n"; is($XS::APItest::BEGIN_called, undef, "BEGIN not yet called"); is($XS::APItest::BEGIN_called_PP, undef, "BEGIN not yet called"); -is($XS::APItest::UNITCHECK_called, undef, "UNITCHECK not yet called"); -is($XS::APItest::UNITCHECK_called_PP, undef, "UNITCHECK not called"); +is($XS::APItest::UNITCHECK_called, undef, "UNITCHECK not yet called") if $uc; +is($XS::APItest::UNITCHECK_called_PP, undef, "UNITCHECK not called") if $uc; is($XS::APItest::CHECK_called, undef, "CHECK not called (too late)"); is($XS::APItest::CHECK_called_PP, undef, "CHECK not called (too late)"); is($XS::APItest::INIT_called, undef, "INIT not called (too late)"); @@ -101,8 +111,8 @@ is($XS::APItest::END_called_PP, undef, "END not yet called"); print "# Second body\n"; is($XS::APItest::BEGIN_called, 1, "BEGIN called"); is($XS::APItest::BEGIN_called_PP, 1, "BEGIN called"); -is($XS::APItest::UNITCHECK_called, 1, "UNITCHECK called"); -is($XS::APItest::UNITCHECK_called_PP, 1, "UNITCHECK called"); +is($XS::APItest::UNITCHECK_called, 1, "UNITCHECK called") if $uc; +is($XS::APItest::UNITCHECK_called_PP, 1, "UNITCHECK called") if $uc; is($XS::APItest::CHECK_called, undef, "CHECK not called (too late)"); is($XS::APItest::CHECK_called_PP, undef, "CHECK not called (too late)"); is($XS::APItest::INIT_called, undef, "INIT not called (too late)"); @@ -114,8 +124,10 @@ BEGIN { print "# Second BEGIN\n"; is($XS::APItest::BEGIN_called, undef, "BEGIN not yet called"); is($XS::APItest::BEGIN_called_PP, undef, "BEGIN not yet called"); - is($XS::APItest::UNITCHECK_called, undef, "UNITCHECK not yet called"); - is($XS::APItest::UNITCHECK_called_PP, undef, "UNITCHECK not called"); + is($XS::APItest::UNITCHECK_called, undef, "UNITCHECK not yet called") + if $uc; + is($XS::APItest::UNITCHECK_called_PP, undef, "UNITCHECK not called") + if $uc; is($XS::APItest::CHECK_called, undef, "CHECK not called"); is($XS::APItest::CHECK_called_PP, undef, "CHECK not called"); is($XS::APItest::INIT_called, undef, "INIT not called"); @@ -128,8 +140,10 @@ CHECK { print "# Second CHECK\n"; is($XS::APItest::BEGIN_called, undef, "BEGIN not yet called"); is($XS::APItest::BEGIN_called_PP, undef, "BEGIN not yet called"); - is($XS::APItest::UNITCHECK_called, undef, "UNITCHECK not yet called"); - is($XS::APItest::UNITCHECK_called_PP, undef, "UNITCHECK not yet called"); + is($XS::APItest::UNITCHECK_called, undef, "UNITCHECK not yet called") + if $uc; + is($XS::APItest::UNITCHECK_called_PP, undef, "UNITCHECK not yet called") + if $uc; is($XS::APItest::CHECK_called, undef, "CHECK not called"); is($XS::APItest::CHECK_called_PP, undef, "CHECK not called"); is($XS::APItest::INIT_called, undef, "INIT not called"); @@ -142,8 +156,10 @@ INIT { print "# Second INIT\n"; is($XS::APItest::BEGIN_called, undef, "BEGIN not yet called"); is($XS::APItest::BEGIN_called_PP, undef, "BEGIN not yet called"); - is($XS::APItest::UNITCHECK_called, undef, "UNITCHECK not yet called"); - is($XS::APItest::UNITCHECK_called_PP, undef, "UNITCHECK not yet called"); + is($XS::APItest::UNITCHECK_called, undef, "UNITCHECK not yet called") + if $uc; + is($XS::APItest::UNITCHECK_called_PP, undef, "UNITCHECK not yet called") + if $uc; is($XS::APItest::CHECK_called, undef, "CHECK not called (too late)"); is($XS::APItest::CHECK_called_PP, undef, "CHECK not called (too late)"); is($XS::APItest::INIT_called, undef, "INIT not called (too late)"); @@ -156,8 +172,8 @@ END { print "# Second END\n"; is($XS::APItest::BEGIN_called, 1, "BEGIN called"); is($XS::APItest::BEGIN_called_PP, 1, "BEGIN called"); - is($XS::APItest::UNITCHECK_called, 1, "UNITCHECK called"); - is($XS::APItest::UNITCHECK_called_PP, 1, "UNITCHECK called"); + is($XS::APItest::UNITCHECK_called, 1, "UNITCHECK called") if $uc; + is($XS::APItest::UNITCHECK_called_PP, 1, "UNITCHECK called") if $uc; is($XS::APItest::CHECK_called, undef, "CHECK not called (too late)"); is($XS::APItest::CHECK_called_PP, undef, "CHECK not called (too late)"); is($XS::APItest::INIT_called, undef, "INIT not called (too late)"); |