YA sync with mainline
[p5sagit/p5-mst-13.2.git] / t / op / lex_assign.t
index 0f65869..2fb059d 100755 (executable)
@@ -24,7 +24,7 @@ sub subb {"in s"}
 
 @INPUT = <DATA>;
 @simple_input = grep /^\s*\w+\s*\$\w+\s*[#\n]/, @INPUT;
-print "1..", (8 + @INPUT + @simple_input), "\n";
+print "1..", (10 + @INPUT + @simple_input), "\n";
 $ord = 0;
 
 sub wrn {"@_"}
@@ -53,6 +53,12 @@ $ord++;
 print "not " unless $dc == 1;
 print "ok $ord\n";
 
+$ord++;
+my $xxx = 'b';
+$xxx = 'c' . ($xxx || 'e');
+print "not " unless $xxx eq 'cb';
+print "ok $ord\n";
+
 {                              # Check calling STORE
   my $sc = 0;
   sub B::TIESCALAR {bless [11], 'B'}
@@ -90,6 +96,18 @@ print "ok $ord\n";
 
 }
 
+# Chains of assignments
+
+my ($l1, $l2, $l3, $l4);
+my $zzzz = 12;
+$zzz1 = $l1 = $l2 = $zzz2 = $l3 = $l4 = 1 + $zzzz;
+
+$ord++;
+print "# $zzz1 = $l1 = $l2 = $zzz2 = $l3 = $l4 = 13\nnot "
+  unless $zzz1 == 13 and $zzz2 == 13 and $l1 == 13
+  and $l2 == 13 and $l3 == 13 and $l4 == 13;
+print "ok $ord\n";
+
 for (@INPUT) {
   $ord++;
   ($op, undef, $comment) = /^([^\#]+)(\#\s+(.*))?/;