X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F30-run_perl.t;h=bfc7bbb7fa477dab0bba34dc76a3b788e2d02c7c;hb=9d12e1a9b21a372b49301b11df9b0720ba484ef4;hp=216519706e134bca5ba807614a005c140dc974ad;hpb=3c878c7cab4d3a227bd77d1fe1fbdec19b2af8ce;p=perl%2Fmodules%2FVPIT-TestHelpers.git diff --git a/t/30-run_perl.t b/t/30-run_perl.t index 2165197..bfc7bbb 100644 --- a/t/30-run_perl.t +++ b/t/30-run_perl.t @@ -3,9 +3,9 @@ use strict; use warnings; -use VPIT::TestHelpers; +use VPIT::TestHelpers 'run_perl' => [ 'VTH' ]; -use Test::More tests => 5; +use Test::More tests => 5 + 2; use Config; use File::Temp; @@ -25,7 +25,9 @@ my %expected_vars = ( 'darwin' => [ ], 'linux' => [ ], ); -push @$_, $ld_path for values %expected_vars; +unless ($^O eq 'darwin') { + push @$_, $ld_path for values %expected_vars; +} my @all_vars = do { my %uniq; @@ -38,16 +40,18 @@ my @ignored_vars = qw< VERSIONER_PERL_VERSION __CF_USER_TEXT_ENCODING >; +push @ignored_vars, $ld_path if $^O eq 'darwin'; for my $os (qw) { 1 while unlink $filename; - local $^O = $os; local %ENV; - @ENV{@all_vars} = @all_vars; - run_perl $code; + { + local $^O = $os; + run_perl $code; + } my %subprocess_env; @@ -66,3 +70,17 @@ for my $os (qw) { is $got, $exp, "run_perl preserving $os ENV vars"; } + +{ + local $@; + eval { + run_perl 'print "hello\n"'; + }; + like $@, qr/^Double quotes in evaluated code are not portable/, + 'croak on double quotes'; +} + +{ + my $msg = VTH_RUN_PERL_FAILED; + like $msg, qr/^Could not execute/, 'RUN_PERL_FAILED error message'; +}