X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F30-run_perl.t;h=2238fb76838cf0f79e8d87d7f35237a16e7a5071;hb=274ec39542b4a7f51a3dd39cd3e9e5dd1ee88eb8;hp=cd040e133c8938e70fce9f21bbcbc77ea01f0ab5;hpb=3d20039698dc108e2111d69c4c73e6fa9cc5c091;p=perl%2Fmodules%2FVPIT-TestHelpers.git diff --git a/t/30-run_perl.t b/t/30-run_perl.t index cd040e1..2238fb7 100644 --- a/t/30-run_perl.t +++ b/t/30-run_perl.t @@ -3,15 +3,17 @@ 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; my $filename = '/tmp/run_perl_test'; +my $guard = VPIT::TestHelpers::Guard->new(sub { unlink $filename }); + my $code = "open my \$fh, q[>], q[$filename] or die \$!; for my \$key (sort keys %ENV) { print \$fh qq[\$key:\$ENV{\$key}\n] } close \$fh"; my $ld_path = $Config::Config{ldlibpthname}; @@ -64,3 +66,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'; +}