From 624c42e21a507311daed2012be92ca7adec9b65f Mon Sep 17 00:00:00 2001 From: Nicolas R Date: Thu, 18 Aug 2016 11:14:51 +1000 Subject: Use set_up_inc for several unit tests Use set_up_inc when require.pl is loaded move plan outside of BEGIN block when no tests are run at BEGIN time. Using set_up_inc allow to run these tests under minitest but also compile them using B::C. This also has the advantage to use a single control point for @INC setup. Note: some tests cannot use 'require test.pl', unshfit is then used for them. --- t/op/magic.t | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 't/op/magic.t') diff --git a/t/op/magic.t b/t/op/magic.t index f8c822b78e..3f71f8ec64 100644 --- a/t/op/magic.t +++ b/t/op/magic.t @@ -3,9 +3,9 @@ BEGIN { $| = 1; chdir 't' if -d 't'; - @INC = '../lib'; require './test.pl'; - plan (tests => 192); + set_up_inc( '../lib' ); + plan (tests => 192); # some tests are run in BEGIN block } # Test that defined() returns true for magic variables created on the fly, @@ -62,6 +62,7 @@ $PERL = $Is_MSWin32 ? '.\perl' : './perl'); + sub env_is { my ($key, $val, $desc) = @_; @@ -706,6 +707,7 @@ is ++${^MPEN}, 1, '${^MPEN} can be incremented'; sub FETCH { push @RT12608::G::ISA, "RT12608::H"; "RT12608::Y"; } } + # ^^^^^^^^^ New tests go here ^^^^^^^^^ SKIP: { -- cgit v1.2.1