Bind op fix.
[p5sagit/p5-mst-13.2.git] / t / op / misc.t
index ab84977..55f459d 100755 (executable)
@@ -60,10 +60,11 @@ EXPECT
 a := b := c
 ########
 $cusp = ~0 ^ (~0 >> 1);
+use integer;
 $, = " ";
-print +($cusp - 1) % 8, $cusp % 8, -$cusp % 8, ($cusp + 1) % 8, "!\n";
+print +($cusp - 1) % 8, $cusp % 8, -$cusp % 8, 8 | (($cusp + 1) % 8 + 7), "!\n";
 EXPECT
-7 0 0 1 !
+7 0 0 8 !
 ########
 $foo=undef; $foo->go;
 EXPECT
@@ -357,11 +358,11 @@ BEGIN { @ARGV = qw(a b c d e) }
 BEGIN { print "argv <@ARGV>\nbegin <",shift,">\n" }
 END { print "end <",shift,">\nargv <@ARGV>\n" }
 INIT { print "init <",shift,">\n" }
-STOP { print "stop <",shift,">\n" }
+CHECK { print "check <",shift,">\n" }
 EXPECT
 argv <a b c d e>
 begin <a>
-stop <b>
+check <b>
 init <c>
 end <d>
 argv <e>
@@ -481,7 +482,7 @@ new1new22DESTROY2new33DESTROY31DESTROY1
 ########
 re();
 sub re {
-    my $re = join '', eval 'qr/(?p{ $obj->method })/';
+    my $re = join '', eval 'qr/(??{ $obj->method })/';
     $re;
 }
 EXPECT
@@ -506,4 +507,54 @@ else {
   if ($x == 0) { print "" } else { print $x }
 }
 EXPECT
-Use of uninitialized value at - line 4.
+Use of uninitialized value in numeric eq (==) at - line 4.
+########
+$x = sub {};
+foo();
+sub foo { eval { return }; }
+print "ok\n";
+EXPECT
+ok
+########
+my @l = qw(hello.* world);
+my $x;
+
+foreach $x (@l) {
+    print "before - $x\n";
+    $x = "\Q$x\E";
+    print "quotemeta - $x\n";
+    $x = "\u$x";
+    print "ucfirst - $x\n";
+    $x = "\l$x";
+    print "lcfirst - $x\n";
+    $x = "\U$x\E";
+    print "uc - $x\n";
+    $x = "\L$x\E";
+    print "lc - $x\n";
+}
+EXPECT
+before - hello.*
+quotemeta - hello\.\*
+ucfirst - Hello\.\*
+lcfirst - hello\.\*
+uc - HELLO\.\*
+lc - hello\.\*
+before - world
+quotemeta - world
+ucfirst - World
+lcfirst - world
+uc - WORLD
+lc - world
+########
+sub f { my $a = 1; my $b = 2; my $c = 3; my $d = 4; next }
+my $x = "foo";
+{ f } continue { print $x, "\n" }
+EXPECT
+foo
+########
+sub C () { 1 }
+sub M { $_[0] = 2; }
+eval "C";
+M(C);
+EXPECT
+Modification of a read-only value attempted at - line 2.