Test <> ovrld with glob override
authorFather Chrysostomos <sprout@cpan.org>
Sat, 28 Apr 2012 07:16:25 +0000 (00:16 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Tue, 22 May 2012 04:35:12 +0000 (21:35 -0700)
While doing a PL_glob_index experiment on a branch, I almost screwed
up the stack for those cases where glob is overridden and there is
iterator overloading.  The tests passed anyway, meaning we need
more tests.

lib/overload.t

index 7657010..df3a9b8 100644 (file)
@@ -48,7 +48,7 @@ package main;
 
 $| = 1;
 BEGIN { require './test.pl' }
-plan tests => 5053;
+plan tests => 5081;
 
 use Scalar::Util qw(tainted);
 
@@ -1857,6 +1857,9 @@ foreach my $op (qw(<=> == != < <= > >=)) {
            or die "open of \$iter_text gave ($!)\n";
        $subs{'<>'} = '<$iter_fh>';
        push @tests, [ $iter_fh, '<%s>', '(<>)', undef, [ 1, 1, 0 ], 1 ];
+       push @tests, [ $iter_fh,
+                     'local *CORE::GLOBAL::glob = sub {}; eval q|<%s>|',
+                     '(<>)', undef, [ 1, 1, 0 ], 1 ];
 
        # eval should do tie, overload on its arg before checking taint */
        push @tests, [ '1;', 'eval q(eval %s); $@ =~ /Insecure/',