Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We pass 53-knowhow.t for ages, but forgot to add it here. :-)
- Loading branch information
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
knowhow Foo { | ||
has $!bbq; | ||
method new() { nqp::instance_of(self) } | ||
method lol() { | ||
"yay, methods" | ||
} | ||
method set_bbq($bbq) { $!bbq := $bbq; } | ||
method get_bbq() { $!bbq } | ||
} | ||
|
||
plan(3); | ||
|
||
ok(Foo.lol eq "yay, methods", "method calls on knowhow type object"); | ||
|
||
my $x := Foo.new; | ||
ok($x.lol eq "yay, methods", "method calls on knowhow instance"); | ||
|
||
$x.set_bbq("wurst"); | ||
ok($x.get_bbq eq "wurst", "attributes on knowhow instance"); |