use strict;
use Config;
-print "1..18\n";
+print "1..19\n";
my $test = 1;
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;
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);
LINE: while (defined($_ = <ARGV>)) {
chomp $_;
- @F = split(/\s+/, $_, 0);
+ @F = split(" ", $_, 0);
'???';
}