]> git.vpit.fr Git - perl/modules/VPIT-TestHelpers.git/blobdiff - t/30-run_perl.t
Add capture feature
[perl/modules/VPIT-TestHelpers.git] / t / 30-run_perl.t
index cd040e133c8938e70fce9f21bbcbc77ea01f0ab5..077b58e598650ac385931e7602df61bc76b95e66 100644 (file)
@@ -5,13 +5,15 @@ use warnings;
 
 use VPIT::TestHelpers;
 
-use Test::More tests => 5;
+use Test::More tests => 5 + 1;
 
 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,12 @@ for my $os (qw<MSWin32 android darwin cygwin linux>) {
 
  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';
+}