Skip to content
This repository has been archived by the owner on Feb 3, 2021. It is now read-only.

Commit

Permalink
Some basic tests for knowhow.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnthn committed Oct 2, 2010
1 parent e33ff5d commit 61e4a50
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions t/nqp/53-knowhow.t
@@ -0,0 +1,19 @@
knowhow Foo {
has $!bbq;
method new() { pir::repr_instance_of__pp(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");

0 comments on commit 61e4a50

Please sign in to comment.