This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
A temporary debugging aid for Tru64 threaded builds.
[perl5.git] / ext / B / t / deparse.t
index 22bd782..50746e7 100644 (file)
@@ -15,7 +15,7 @@ use warnings;
 use strict;
 use Config;
 
-print "1..16\n";
+print "1..18\n";
 
 use B::Deparse;
 my $deparse = B::Deparse->new() or print "not ";
@@ -25,7 +25,7 @@ print "ok " . $i++ . "\n";
 
 # Tell B::Deparse about our ambient pragmas
 { my ($hint_bits, $warning_bits);
- BEGIN {($hint_bits, $warning_bits) = ($^H, ${^WARNING_BITS})}
+ BEGIN { ($hint_bits, $warning_bits) = ($^H, ${^WARNING_BITS}); }
  $deparse->ambient_pragmas (
      hint_bits    => $hint_bits,
      warning_bits => $warning_bits,
@@ -99,7 +99,7 @@ $path .= " -MMac::err=unix" if $Is_MacOS;
 my $redir = $Is_MacOS ? "" : "2>&1";
 
 $a = `$^X $path "-MO=Deparse" -anlwi.bak -e 1 $redir`;
-$a =~ s/(?:# )?-e syntax OK\n//g;  # "# " for Mac OS
+$a =~ s/-e syntax OK\n//g;
 $a =~ s/.*possible typo.*\n//;    # Remove warning line
 $a =~ s{\\340\\242}{\\s} if (ord("\\") == 224); # EBCDIC, cp 1047 or 037
 $a =~ s{\\274\\242}{\\s} if (ord("\\") == 188); # $^O eq 'posix-bc'
@@ -113,7 +113,18 @@ LINE: while (defined($_ = <ARGV>)) {
     '???';
 }
 EOF
-print "# [$a]\n\# vs expected\n# [$b]\nnot " if $a ne $b;
+$b =~ s/(LINE:)/sub BEGIN {
+    'MacPerl'->bootstrap;
+    'OSA'->bootstrap;
+    'XL'->bootstrap;
+}
+$1/ if $Is_MacOS;
+if ($a ne $b) {
+    # A temporary debugging aid (Tru64 threaded smoke test somehow
+    # broke between 19150 and 19160, but works okay from command line.)
+    print STDERR "# [$a]\n\# vs expected\n# [$b]\n";
+    print "not ";
+}
 print "ok " . $i++ . "\n";
 
 __DATA__
@@ -184,3 +195,9 @@ $x{warn()};
 # 13
 my $foo;
 $_ .= <ARGV> . <$foo>;
+####
+# 14
+my $foo = "Ab\x{100}\200\x{200}\377Cd\000Ef\x{1000}\cA\x{2000}\cZ";
+####
+# 15
+s/x/'y';/e;