This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
split.t: More tests for perl #123057
authorFather Chrysostomos <sprout@cpan.org>
Tue, 28 Oct 2014 21:34:10 +0000 (14:34 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Wed, 29 Oct 2014 00:46:59 +0000 (17:46 -0700)
There are three different variants to split-to-array, so test that
op_lvalue_flags can handle all three.

t/op/split.t

index 51e0d1d..9afdd6e 100644 (file)
@@ -6,7 +6,7 @@ BEGIN {
     set_up_inc('../lib');
 }
 
-plan tests => 123;
+plan tests => 125;
 
 $FS = ':';
 
@@ -507,4 +507,11 @@ is "@aaa", "f o o b a r b a z",
 is "@a", "a b c", '() = split-to-array';
 
 (@a = split //, "abc") = 1..10;
-is "@a", '1 2 3', 'assignment to split-to-array';
+is "@a", '1 2 3', 'assignment to split-to-array (pmtarget/package array)';
+{
+  my @a;
+  (@a = split //, "abc") = 1..10;
+  is "@a", '1 2 3', 'assignment to split-to-array (targ/lexical)';
+}
+(@{\@a} = split //, "abc") = 1..10;
+is "@a", '1 2 3', 'assignment to split-to-array (stacked)';