Change 28484 by [EMAIL PROTECTED] on 2006/07/05 14:10:18

        Add a TODO test for list assignment to a list of state variables.
        Not sure yet how to encode in the optree the information that
        state($x, $y) and (state $x, state $y) must be treated differently.

Affected files ...

... //depot/perl/t/op/state.t#7 edit

Differences ...

==== //depot/perl/t/op/state.t#7 (text) ====
Index: perl/t/op/state.t
--- perl/t/op/state.t#6~28106~  2006-05-05 05:48:19.000000000 -0700
+++ perl/t/op/state.t   2006-07-05 07:10:18.000000000 -0700
@@ -10,7 +10,7 @@
 use strict;
 use feature "state";
 
-plan tests => 30;
+plan tests => 32;
 
 ok( ! defined state $uninit, q(state vars are undef by default) );
 
@@ -137,3 +137,21 @@
 
 $xhval = stateful_hash();
 is( $xhval, 1, 'uninitialized state hash after one iteration' );
+
+# state declaration with a list
+
+sub statelist {
+    # note that this should be a state assignment, while (state $lager, state 
$stout) shouldn't
+    state($lager, $stout) = (11, 22);
+    $lager++;
+    $stout++;
+    "$lager/$stout";
+}
+
+my $ls = statelist();
+is($ls, "12/23", 'list assignment to state scalars');
+$ls = statelist();
+{
+    local our $TODO = 'make aassign handle state vars';
+    is($ls, "13/24", 'list assignment to state scalars');
+}
End of Patch.

Reply via email to