This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Move the test for recursive call to Perl_load_module to t/io/perlio.t
authorNicholas Clark <nick@ccl4.org>
Fri, 23 Sep 2011 10:48:20 +0000 (12:48 +0200)
committerNicholas Clark <nick@ccl4.org>
Fri, 23 Sep 2011 10:48:20 +0000 (12:48 +0200)
It's a croak(), not a warning, so doesn't really belong in lib/warnings.t
[This also implicitly fixes the wrong expected output of 69dc7e4bdb8e397c]

t/io/perlio.t
t/lib/warnings/perlio

index f6e7fc4..18c2028 100644 (file)
@@ -6,7 +6,7 @@ BEGIN {
        skip_all_without_perlio();
 }
 
-plan tests => 44;
+plan tests => 45;
 
 use_ok('PerlIO');
 
@@ -201,6 +201,20 @@ SKIP: {
 
 }
 
+{
+    # see RT #75722, RT #96008
+    fresh_perl_like(<<'EOP',
+unshift @INC, sub {
+    return undef unless caller eq "main";
+    open my $fh, "<", \1;
+    $fh;
+};
+require Symbol; # doesn't matter whether it exists or not
+EOP
+                   qr/\ARecursive call to Perl_load_module in PerlIO_find_layer at/s,
+                   {stderr => 1},
+                   'Mutal recursion between Perl_load_module and PerlIO_find_layer croaks');
+}
 
 END {
     unlink_all $txt;
index d90453b..0ccc5a8 100644 (file)
@@ -24,18 +24,6 @@ Unknown PerlIO layer \"%.*s\"
 
 __END__
 
-# perlio [PerlIO_find_layer]
-unshift @INC, sub {
-    return undef unless caller eq "main";
-    open my $fh, "<", \1;
-    $fh;
-};
-require Symbol; # doesn't matter whether it exists or no
-EXPECT
-Recursive call to Perl_load_module in PerlIO_find_layer at - line 5.
-BEGIN failed--compilation aborted.
-########
-
 # perlio [PerlIO_parse_layers]
 no warnings 'layer';
 open(F, ">:-aa", "bb");