summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-07-05 14:10:18 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-07-05 14:10:18 +0000
commita53dbfbbdde69373524fb559de5b51e406df6721 (patch)
treee606e8e4874adc23a90825298d0b10409159370e
parent9ab92c4288af6d31a3e99bfe76775c698438b981 (diff)
downloadperl-a53dbfbbdde69373524fb559de5b51e406df6721.tar.gz
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. p4raw-id: //depot/perl@28484
-rw-r--r--t/op/state.t20
1 files changed, 19 insertions, 1 deletions
diff --git a/t/op/state.t b/t/op/state.t
index ebe8d9b5c3..6d09813fe1 100644
--- a/t/op/state.t
+++ b/t/op/state.t
@@ -10,7 +10,7 @@ BEGIN {
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 @@ is( $xhval, 0, 'uninitialized state hash' );
$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');
+}