File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change 1
- plan (6 );
1
+ plan (10 );
2
2
3
3
class Foo {
4
4
has @ ! pos_foo ;
@@ -30,3 +30,18 @@ ok($foo<1> == 678,"associative access is seperate");
30
30
ok ($ foo <bar > eq ' hello' ," assosiative storage takes strings as keys" );
31
31
ok ($ foo . get_pos_1 == 456 ," positional are stored in the attribute" );
32
32
ok ($ foo . get_assoc_1 == 678 ," associatives are stored in the attribute" );
33
+
34
+ my $ pos_attr ;
35
+ my $ assoc_attr ;
36
+ for Foo. HOW . attributes (Foo) -> $ attr {
37
+ if $ attr . name eq ' @!pos_bar' {
38
+ $ pos_attr := $ attr ;
39
+ }
40
+ elsif $ attr . name eq ' %!assoc_bar' {
41
+ $ assoc_attr := $ attr ;
42
+ }
43
+ }
44
+ ok ($ pos_attr . positional_delegate == 1 ," positional_delegate is set correctly" );
45
+ ok ($ pos_attr . associative_delegate == 0 ," positional_delegate is not set incorrectly" );
46
+ ok ($ assoc_attr . positional_delegate == 0 ," associative_delegate is not set incorrectly" );
47
+ ok ($ assoc_attr . associative_delegate == 1 ," associative_delegate is set correctly" );
You can’t perform that action at this time.
0 commit comments