Skip to content

Commit ee08acb

Browse files
committed
simplify tests; not sure how correct they are :(
1 parent 1867d4a commit ee08acb

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

S12-attributes/mutators.t

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ class LValueMutator {
1111
has Int $.foo;
1212
has Int $!bar;
1313

14-
method foo returns Int is rw {
14+
method foo is rw {
1515
return $!bar;
1616
}
17-
method get_foo returns Int is rw {
17+
method get_foo is rw {
1818
return $.foo;
1919
}
2020
}
@@ -33,7 +33,7 @@ is($lvm.get_foo, 6, "lvalue accessors work");
3333
lives_ok { $lvm.foo = 5 }, "lvalue accessors work still";
3434
is($lvm.foo, 5, "mutator seems to work");
3535

36-
our Int $count = 0;
36+
our $count = 0;
3737

3838
class MagicVal {
3939
has Int $.constant;
@@ -74,20 +74,20 @@ is($count, 2, "mutator was called");
7474

7575
# test interface tentatively not entirely disapproved of by
7676
# all(@Larry) at L<"http://xrl.us/gnxp">
77-
class MagicSub {
78-
has Int $.constant;
79-
has Int $.varies is rw;
80-
81-
method varies returns Int is rw {
82-
return Proxy.new(
83-
:FETCH{ $.varies += 2 },
84-
:STORE{ $.varies = $^v + 1 }
85-
);
86-
}
87-
}
88-
8977
#?rakudo skip 'class Proxy'
9078
{
79+
class MagicSub {
80+
has Int $.constant;
81+
has Int $.varies is rw;
82+
83+
method varies returns Int is rw {
84+
return Proxy.new(
85+
:FETCH{ $.varies += 2 },
86+
:STORE{ $.varies = $^v + 1 }
87+
);
88+
}
89+
}
90+
9191
my $mv = MagicVal.new(:constant(6), :varies(6));
9292

9393
is($mv.constant, 6, "normal attribute");

0 commit comments

Comments
 (0)