Change 28498 by [EMAIL PROTECTED] on 2006/07/06 16:55:57
The state() implementation is not yet perfect. Check in a new todo test
Affected files ...
... //depot/perl/t/op/state.t#9 edit
Differences ...
==== //depot/perl/t/op/state.t#9 (text) ====
Index: perl/t/op/state.t
--- perl/t/op/state.t#8~28489~ 2006-07-05 14:00:31.000000000 -0700
+++ perl/t/op/state.t 2006-07-06 09:55:57.000000000 -0700
@@ -10,7 +10,7 @@
use strict;
use feature "state";
-plan tests => 32;
+plan tests => 34;
ok( ! defined state $uninit, q(state vars are undef by default) );
@@ -105,6 +105,7 @@
# stateless assignment to a state variable
sub stateless {
+ no warnings 'misc';
(state $reinitme, my $foo) = (42, 'bar');
++$reinitme;
}
@@ -152,3 +153,17 @@
is($ls, "12/23", 'list assignment to state scalars');
$ls = statelist();
is($ls, "13/24", 'list assignment to state scalars');
+
+sub statelist2 {
+ state($sherry, $bourbon) = (1 .. 2);
+ $sherry++;
+ $bourbon++;
+ "$sherry/$bourbon";
+}
+
+$ls = statelist2();
+is($ls, "2/3", 'list assignment to state scalars');
+$ls = statelist2();
+{ local our $TODO = 'detection of state vars is misplaced in newASSIGNOP';
+is($ls, "3/4", 'list assignment to state scalars');
+}
End of Patch.