Upgrade to Win32API-File 0.1101
[p5sagit/p5-mst-13.2.git] / ext / B / t / terse.t
index b11c873..8d86a49 100644 (file)
@@ -1,8 +1,17 @@
 #!./perl
 
 BEGIN {
-       chdir 't' if -d 't';
-       @INC = '../lib';
+        if ($ENV{PERL_CORE}){
+               chdir('t') if -d 't';
+               @INC = ('.', '../lib');
+        } else {
+               unshift @INC, 't';
+        }
+       require Config;
+       if (($Config::Config{'extensions'} !~ /\bB\b/) ){
+               print "1..0 # Skip -- Perl configured without B module\n";
+               exit 0;
+       }
 }
 
 use Test::More tests => 16;
@@ -45,8 +54,8 @@ foreach (@lines) {
                my $op = $1;
                next unless exists $ops{$op};
                like( $_, $ops{$op}, "$op " );
-               delete $ops{$op};
                s/$ops{$op}//;
+               delete $ops{$op};
                redo if $_;
        }
 }
@@ -71,7 +80,7 @@ sub bar {
        $a = 1.234;
 
        # this is awful, but it gives a PMOP
-       my $boo = split('', $foo);
+       our @ary = split('', $foo);
 
        # PVOP, LOOP
        LOOP: for (1 .. 10) {
@@ -90,7 +99,11 @@ my $path = join " ", map { qq["-I$_"] } @INC;
 $path = '-I::lib -MMac::err=unix' if $^O eq 'MacOS';
 my $redir = $^O eq 'MacOS' ? '' : "2>&1";
 my $items = qx{$^X $path "-MO=Terse" -le "print \\42" $redir};
-like( $items, qr/RV $hex \\42/, 'RV' );
+if( $] >= 5.011 ) {
+    like( $items, qr/IV $hex \\42/, 'RV (but now stored in an IV)' );
+} else {
+    like( $items, qr/RV $hex \\42/, 'RV' );
+}
 
 package TieOut;