@INC = '../lib';
}
-plan 12;
+plan 17;
use B qw 'svref_2object OPpASSIGN_COMMON';
is $last_expr->name, 'const', "$tn optimised to constant";
is $sub->(), $expect, "$tn folded correctly";
}
+
+
+# split to array
+
+for(['@pkgary' , '@_' ],
+ ['@lexary' , 'my @a; @a'],
+ ['my(@array)' , 'my(@a)' ],
+ ['local(@array)', 'local(@_)'],
+ ['@{...}' , '@{\@_}' ],
+){
+ my($tn,$code) = @$_;
+ my $sub = eval "sub { $code = split }";
+ my $split = svref_2object($sub)->ROOT->first->last;
+ is $split->name, 'split', "$tn = split swallows up the assignment";
+}