Skip to content

Commit f211650

Browse files
committed
also test parenthesized invocant colon
1 parent 88c52fa commit f211650

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

S12-methods/indirect_notation.t

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use Test;
44

55
# L<S12/Method calls/"Indirect object notation now requires a colon after the invocant, even if there are no arguments">
66

7-
plan 34;
7+
plan 37;
88

99

1010
##### Without arguments
@@ -19,8 +19,9 @@ class T1 {
1919
ok( $o, "Still alive after new" );
2020

2121
is( $o.a(), 'test', "The direct object notation call without arguments" );
22-
#?niecza skip 'Invocant handling is NYI'
23-
is( (a $o:), 'test', "The indirect object notation call without arguments" );
22+
#?niecza 2 skip 'Invocant handling is NYI'
23+
is( (a $o:), 'test', "The indirect object notation call without arguments without ()" );
24+
is( a($o:), 'test', "The indirect object notation call without arguments with ()" );
2425
}
2526

2627
##### With arguments
@@ -38,13 +39,16 @@ class T2 {
3839
ok( $o, "Still alive after new" );
3940
my $seed = 1000.rand;
4041
is( $o.a( $seed ), $seed, "The direct object notation call with argument" );
41-
#?niecza skip 'Invocant handling is NYI'
42-
is( (a $o: $seed), $seed, "The indirect object notation call with argument" );
42+
#?niecza 2 skip 'Invocant handling is NYI'
43+
is( (a $o: $seed), $seed, "The indirect object notation call with argument without ()" );
44+
is( a($o: $seed), $seed, "The indirect object notation call with argument with ()" );
4345

4446
my $name = 'a';
4547
eval_dies_ok('$name $o: $seed', 'Indirect object notation and indirect method calls cannot be combined');
4648

47-
is (b $o: 21, 21), 42, "The indirect object notation call with multiple arguments";
49+
#?niecza 2 skip 'Invocant handling is NYI'
50+
is (b $o: 21, 21), 42, "The indirect object notation call with multiple arguments without ()";
51+
is b($o: 21, 21), 42, "The indirect object notation call with multiple arguments with ()";
4852
}
4953

5054

0 commit comments

Comments
 (0)