The #9735 also changes the subtest 12.
[p5sagit/p5-mst-13.2.git] / t / lib / b.t
index b10479d..65a8013 100755 (executable)
--- a/t/lib/b.t
+++ b/t/lib/b.t
@@ -15,7 +15,7 @@ use warnings;
 use strict;
 use Config;
 
-print "1..18\n";
+print "1..19\n";
 
 my $test = 1;
 
@@ -25,6 +25,16 @@ use B::Deparse;
 my $deparse = B::Deparse->new() or print "not ";
 ok;
 
+# Tell B::Deparse about our ambient pragmas
+{ my ($hint_bits, $warning_bits);
+ BEGIN {($hint_bits, $warning_bits) = ($^H, ${^WARNING_BITS})}
+ $deparse->ambient_pragmas (
+     hint_bits    => $hint_bits,
+     warning_bits => $warning_bits,
+     '$['         => 0 + $[
+ );
+}
+
 print "not " if "{\n    1;\n}" ne $deparse->coderef2text(sub {1});
 ok;
 
@@ -70,6 +80,11 @@ use constant 'c', 'stuff';
 print "not " if (eval "sub ".$deparse->coderef2text(\&c))->() ne 'stuff';
 ok;
 
+$a = 0;
+print "not " if "{\n    (-1) ** \$a;\n}"
+               ne $deparse->coderef2text(sub{(-1) ** $a });
+ok;
+
 # XXX ToDo - constsub that returns a reference
 #use constant cr => ['hello'];
 #my $string = "sub " . $deparse->coderef2text(\&cr);
@@ -92,7 +107,7 @@ $b = <<'EOF';
 
 LINE: while (defined($_ = <ARGV>)) {
     chomp $_;
-    @F = split(/\s+/, $_, 0);
+    @F = split(" ", $_, 0);
     '???';
 }
 
@@ -140,7 +155,7 @@ ok;
 
 chomp($a = `$^X $path "-MB::Stash" "-Mwarnings" -e1`);
 $a = join ',', sort split /,/, $a;
-$a =~ s/-u(perlio|open)(?:::\w+)?,//g if defined $Config{'useperlio'} and $Config{'useperlio'} eq 'define';
+$a =~ s/-u(PerlIO|open)(?:::\w+)?,//g if defined $Config{'useperlio'} and $Config{'useperlio'} eq 'define';
 $a =~ s/-uWin32,// if $^O eq 'MSWin32';
 $a =~ s/-u(Cwd|File|File::Copy|OS2),//g if $^O eq 'os2';
 $a =~ s/-uCwd,// if $^O eq 'cygwin';