+ {
+ my $desc = 'double partial init';
+ local $calls = 0;
+ my Int ($x, undef, $y) = ('x');
+ is $calls, 2, "$desc: correct number of calls";
+ is $x, 'x', "$desc: initialized \$x correctly";
+ is $y, undef, "$desc: initialized \$y correctly";
+ }
+
+ {
+ my $desc = 'quadruple init with parens';
+ local $calls = 0;
+ my Int ($x, ($y, $z), $t) = ('x', 'y');
+ is $calls, 4, "$desc: correct number of calls";
+ is $x, 'x', "$desc: initialized \$x correctly";
+ is $y, 'y', "$desc: initialized \$y correctly";
+ is $z, undef, "$desc: initialized \$z correctly";
+ is $t, undef, "$desc: initialized \$t correctly";
+ }
+
+ {
+ my $desc = 'quadruple init with parens and undef';
+ local $calls = 0;
+ my Int ($x, ($y, undef, $z), $t) = ('x', 'y');
+ is $calls, 4, "$desc: correct number of calls";
+ is $x, 'x', "$desc: initialized \$x correctly";
+ is $y, 'y', "$desc: initialized \$y correctly";
+ is $z, undef, "$desc: initialized \$z correctly";
+ is $t, undef, "$desc: initialized \$t correctly";
+ }
+
+ {
+ my $desc = 'for';
+ local $calls = 0;
+ for my Int $x (0) {
+ is $calls, 0, "$desc: correct number of calls";
+ is $x, 0, "$desc: initialized correctly";
+ }
+ }
+
+ {
+ my $desc = 'argument list';
+ local $calls = 0;
+ sub {
+ my Int ($x, $y) = @_;
+ is $calls, 2, "$desc: correct number of calls";
+ is $x, 'x', "$desc: initialized \$x correctly";
+ is $y, 'y', "$desc: initialized \$y correctly";
+ }->('x', 'y');
+ }
+
+ {
+ my $desc = 'argument list with undef begin';
+ local $calls = 0;
+ sub {
+ my Int (undef, $x, $y) = @_;
+ is $calls, 2, "$desc: correct number of calls";
+ is $x, 'y', "$desc: initialized \$x correctly";
+ is $y, undef, "$desc: initialized \$y correctly";
+ }->('x', 'y');
+ }
+
+ {
+ my $desc = 'argument list with undef middle';
+ local $calls = 0;
+ sub {
+ my Int ($x, undef, $y) = @_;
+ is $calls, 2, "$desc: correct number of calls";
+ is $x, 'x', "$desc: initialized \$x correctly";
+ is $y, undef, "$desc: initialized \$y correctly";
+ }->('x', 'y');
+ }
+
+ {
+ my $desc = 'argument list with undef end';
+ local $calls = 0;
+ sub {
+ my Int ($x, $y, undef) = @_;
+ is $calls, 2, "$desc: correct number of calls";
+ is $x, 'x', "$desc: initialized \$x correctly";
+ is $y, 'y', "$desc: initialized \$y correctly";
+ }->('x', 'y');
+ }
+
+ {
+ my $desc = 'argument list with parens';
+ local $calls = 0;
+ sub {
+ my Int ($x, ($y, $z), $t) = @_;
+ is $calls, 4, "$desc: correct number of calls";
+ is $x, 'x', "$desc: initialized \$x correctly";
+ is $y, 'y', "$desc: initialized \$y correctly";
+ is $z, 'z', "$desc: initialized \$z correctly";
+ is $t, 't', "$desc: initialized \$t correctly";
+ }->('x', 'y', 'z', 't');
+ }