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 21af32a commit 0e83ea3Copy full SHA for 0e83ea3
t/nqp/65-how.t
@@ -0,0 +1,20 @@
1
+#!./parrot nqp.pbc
2
+
3
+# check subs
4
5
+plan(4);
6
7
+class Foo {
8
+ has $!foo_attr;
9
+}
10
+class Bar is Foo {
11
+ has $!bar_attr;
12
13
14
+my $foo := Foo.new();
15
+my @Foo-attrs := $foo.HOW.attributes($foo,:local(1));
16
+ok(@Foo-attrs[0].name eq '$!foo_attr',"we can get an attribute");
17
+my $bar := Bar.new();
18
+ok(+$bar.HOW.attributes($bar,:local(1)) == 1,"we only get local attributes");
19
+ok(+$bar.HOW.attributes($bar,:local(0)) == 2,"we get all attributes");
20
+ok($bar.HOW.attributes($bar) == 2,"we can skip :local");
0 commit comments