X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2Findirect.git;a=blobdiff_plain;f=t%2F33-compilation-errors.t;h=eb2af021cd943a5c0e1a16f056c7591791a8cc93;hp=be01768a99c07a1af6a155c49723c40d9773a9f2;hb=03bcfb394b73ec0af103d5afadb16aa3c30df109;hpb=4f7c4a9fe4fd2332dd2a748b17171f9d45129e4f diff --git a/t/33-compilation-errors.t b/t/33-compilation-errors.t index be01768..eb2af02 100644 --- a/t/33-compilation-errors.t +++ b/t/33-compilation-errors.t @@ -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'; +}