From 1ce8be81dfaf09bc8a07faeba2fd9a3a0e4012be Mon Sep 17 00:00:00 2001 From: Nicolas R Date: Thu, 14 Sep 2017 14:51:13 -0600 Subject: tests - Use set_up_inc helper to set @INC Test plan should not be declared at compile time --- t/comp/parser_run.t | 4 ++-- t/op/threads-dirh.t | 16 ++++++++-------- t/re/anyof.t | 6 ++++-- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/t/comp/parser_run.t b/t/comp/parser_run.t index af35758bee..eba4b9fba8 100644 --- a/t/comp/parser_run.t +++ b/t/comp/parser_run.t @@ -5,11 +5,11 @@ # Note that this should still be runnable under miniperl. BEGIN { - @INC = qw(. ../lib ); chdir 't' if -d 't'; + require './test.pl'; + set_up_inc( qw(. ../lib ) ); } -require './test.pl'; plan(4); # [perl #130814] can reallocate lineptr while looking ahead for diff --git a/t/op/threads-dirh.t b/t/op/threads-dirh.t index e1d5c996ad..82d90768ab 100644 --- a/t/op/threads-dirh.t +++ b/t/op/threads-dirh.t @@ -4,21 +4,21 @@ BEGIN { chdir 't' if -d 't'; - @INC = '../lib'; require './test.pl'; + set_up_inc('../lib'); $| = 1; - require Config; - skip_all_without_config('useithreads'); - skip_all_if_miniperl("no dynamic loading on miniperl, no threads"); - - plan(6); } +skip_all_without_config('useithreads'); +skip_all_if_miniperl("no dynamic loading on miniperl, no threads"); + +plan(6); + use strict; use warnings; -use threads; -use threads::shared; +eval q/use threads/; +eval q/use threads::shared/; use File::Path; use File::Spec::Functions qw 'updir catdir'; use Cwd 'getcwd'; diff --git a/t/re/anyof.t b/t/re/anyof.t index 84f2881e0d..d24e4a71a8 100644 --- a/t/re/anyof.t +++ b/t/re/anyof.t @@ -1,3 +1,5 @@ +#!./perl + use utf8; # This tests that the ANYOF nodes generated by bracketed character classes are @@ -10,9 +12,9 @@ use utf8; BEGIN { chdir 't' if -d 't'; - @INC = ('../lib','.','../ext/re'); - require Config; import Config; require './test.pl'; + set_up_inc('../lib','.','../ext/re'); + require Config; import Config; skip_all('no re module') unless defined &DynaLoader::boot_DynaLoader; } -- cgit v1.2.1