Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix 58-attrs.t
  • Loading branch information
moritz committed Jul 26, 2011
1 parent 95fbb94 commit 4a314bf
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions t/nqp/58-attrs.t
Expand Up @@ -3,16 +3,16 @@
plan(2);

class Foo {
has $bar;

has $!answer;
method question() { $!answer := 42 };
method question($what) { $!answer := $what }
method answer() { $!answer }
};

my $foo := Foo.new;
my $first := Foo.new;
my $second := Foo.new;

$foo.question();
ok($foo.answer == 42, "Read-only accessors works");
$first.question(42);
$second.question(23);
ok($first.answer == 42, "attributes work");
ok($second.answer == 23, "... and are not shared among objects");

$foo.bar(42);
ok($foo.bar == 42, 'Read-write accessors works');

0 comments on commit 4a314bf

Please sign in to comment.