Skip to content

Commit bf3ad8c

Browse files
committed
Removed bogus reference to state variable tests
1 parent 6f2280d commit bf3ad8c

File tree

1 file changed

+2
-38
lines changed

1 file changed

+2
-38
lines changed

S04-declarations/state.t

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use v6;
22

33
use Test;
44

5-
plan 43;
5+
plan 40;
66

77
# L<S04/The Relationship of Blocks and Declarations/There is a new state declarator that introduces>
88

@@ -114,50 +114,14 @@ plan 43;
114114
is $rhs_calls, 1, 'RHS of state $x = ... only called once';
115115
}
116116

117-
# Return of a reference to a state() var
118-
#?rakudo skip 'references'
119-
#?DOES 1
120-
{
121-
my $gen = {
122-
state $svar = 42;
123-
\$svar;
124-
};
125-
126-
my $svar_ref = $gen();
127-
$$svar_ref++; $$svar_ref++;
128-
129-
$svar_ref = $gen();
130-
#?pugs todo "state bug"
131-
is $$svar_ref, 44, "reference to a state() var";
132-
}
133-
134-
# Anonymous state vars
135-
# L<http://groups.google.de/group/perl.perl6.language/msg/07aefb88f5fc8429>
136-
# fudged a bit on syntax
137-
#?pugs todo 'anonymous state vars'
138-
#?rakudo todo 'references and anonymous state vars'
139-
#?DOES 1
140-
{
141-
my $gen = sub { \(state $ ) };
142-
143-
my $svar_ref = $gen(); # $svar == 0
144-
try { $$svar_ref++; $$svar_ref++ }; # $svar == 2
145-
146-
$svar_ref = $gen(); # $svar == 2
147-
is try { $$svar_ref }, 2, "anonymous state() vars";
148-
}
149-
150-
#?rakudo todo 'nom regression'
151-
eval_lives_ok 'if 0 { \(state $) }', '$) not misinterpreted in capterm';
152-
153117
# L<http://www.nntp.perl.org/group/perl.perl6.language/20888>
154118
# ("Re: Declaration and definition of state() vars" from Larry)
155119
#?pugs eval 'Parse error'
156120
{
157121
my ($a, $b);
158122
my $gen = {
159123
(state $svar) = 42;
160-
my $ret = { $svar++ };
124+
-> { $svar++ };
161125
};
162126

163127
$a = $gen(); # $svar == 42

0 commit comments

Comments
 (0)