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};
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';
+}