From: Nicholas Clark Date: Mon, 17 Sep 2007 12:21:01 +0000 (+0000) Subject: Some more state variable deparse tests. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7ddd1a01ef22f1bc137d869ae726178f12ff8714;p=p5sagit%2Fp5-mst-13.2.git Some more state variable deparse tests. p4raw-id: //depot/perl@31885 --- diff --git a/ext/B/t/deparse.t b/ext/B/t/deparse.t index 3d3df2d..bda7937 100644 --- a/ext/B/t/deparse.t +++ b/ext/B/t/deparse.t @@ -22,7 +22,7 @@ BEGIN { use warnings; use strict; use feature ":5.10"; -use Test::More tests => 52; +use Test::More tests => 54; use B::Deparse; my $deparse = B::Deparse->new(); @@ -337,8 +337,20 @@ my $bar; # 44 'Foo'->bar; #### -# 45 state vars +# 45 say +say 'foo'; +#### +# 46 state vars state $x = 42; #### -# 46 say -say 'foo'; +# 47 state var assignment +{ + my $y = (state $x = 42); +} +#### +# 48 state vars in anoymous subroutines +$a = sub { + state $x; + return $x++; +} +;