diff options
author | Nicolas R <atoomic@cpan.org> | 2017-09-14 14:51:13 -0600 |
---|---|---|
committer | James E Keenan <jkeenan@cpan.org> | 2017-09-15 13:14:39 -0400 |
commit | 1ce8be81dfaf09bc8a07faeba2fd9a3a0e4012be (patch) | |
tree | d5b38040c61c562f7c30193638314ffea3a21cd7 | |
parent | 45d67106f8acd7bf2229260c4804817a9c1c2578 (diff) | |
download | perl-1ce8be81dfaf09bc8a07faeba2fd9a3a0e4012be.tar.gz |
tests - Use set_up_inc helper to set @INC
Test plan should not be declared at compile time
-rw-r--r-- | t/comp/parser_run.t | 4 | ||||
-rw-r--r-- | t/op/threads-dirh.t | 16 | ||||
-rw-r--r-- | 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; } |