We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a4caa5d commit 69800edCopy full SHA for 69800ed
t/nqp/070-invokespec.t
@@ -1,4 +1,4 @@
1
-plan(11);
+plan(13);
2
class Foo {
3
has $!here_we_keep_the_code_ref;
4
has $!other_place_we_could_keep_the_code_ref_in;
@@ -31,6 +31,15 @@ class Baz {
31
ok(nqp::isinvokable(Foo) == 1, "nqp::isinvokable works on objects that have a set invokespec");
32
ok(nqp::isinvokable(Baz) == 0, "nqp::isinvokable works on objects that don't have a set invokespec");
33
34
+my $with_args := Foo.new();
35
+$with_args.set_code_ref(sub (*@args) {
36
+ is(nqp::elems(@args), 2, 'correct number of elements with setinvokespec');
37
+ ok(@args[0] eq 'fooarg' && @args[1] eq 'bararg', '...with correct values');
38
+});
39
+$with_args('fooarg', 'bararg');
40
+
41
42
43
class Second {
44
has $!attr;
45
has $!ret;
0 commit comments