]> git.vpit.fr Git - perl/modules/indirect.git/blobdiff - t/33-compilation-errors.t
Also test no indirect fatal and compilation errors in require
[perl/modules/indirect.git] / t / 33-compilation-errors.t
index be01768a99c07a1af6a155c49723c40d9773a9f2..eb2af021cd943a5c0e1a16f056c7591791a8cc93 100644 (file)
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 4;
+use Test::More tests => 5;
 
 use lib 't/lib';
 use VPIT::TestHelpers 'capture';
@@ -26,6 +26,7 @@ my $indirect_msg = qr/Indirect call of method "baz" on object "\$_"/;
 my $core_err1    = qr/Global symbol "\$bar"/;
 my $core_err2    = qr/Global symbol "\$ook"/;
 my $aborted      = qr/Execution of -e aborted due to compilation errors\./;
+my $failed_req   = qr/Compilation failed in require/;
 my $line_end     = qr/[^\n]*\n/;
 my $compile_err_warn_exp  = qr/$indirect_msg$line_end$core_err2$line_end/o;
 my $compile_err_fatal_exp = qr/$core_err1$line_end$indirect_msg$line_end/o;
@@ -58,3 +59,10 @@ SKIP: {
  like $@, qr/\A$compile_err_fatal_exp\z/o,
             'no indirect fatal does not hide compilation errors inside of eval';
 }
+
+{
+ local $@;
+ eval { require indirect::TestCompilationError };
+ like $@, qr/\A$compile_err_fatal_exp$failed_req$line_end\z/o,
+         'no indirect fatal does not hide compilation errors inside of require';
+}