From 61e4a50ec227f5e35a46e3c9821409401f3fa22d Mon Sep 17 00:00:00 2001 From: Jonathan Worthington Date: Sat, 2 Oct 2010 18:30:48 +0200 Subject: [PATCH] Some basic tests for knowhow. --- t/nqp/53-knowhow.t | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 t/nqp/53-knowhow.t diff --git a/t/nqp/53-knowhow.t b/t/nqp/53-knowhow.t new file mode 100644 index 0000000..b80919a --- /dev/null +++ b/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");