Skip to content

Commit 9136369

Browse files
committed
Spec WhateverCode.assuming
Covers R#1735: rakudo/rakudo#1735 Rakudo fix: rakudo/rakudo@6e8dc6f132
1 parent dcdbcb3 commit 9136369

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

S02-types/whatever.t

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use lib $?FILE.IO.parent(2).add("packages");
55
use Test;
66
use Test::Util;
77

8-
plan 128;
8+
plan 129;
99

1010
# L<S02/The Whatever Object/"The * character as a standalone term captures the notion of">
1111
# L<S02/Native types/"If any native type is explicitly initialized to">
@@ -499,4 +499,13 @@ subtest 'can curry chains with .& calls on them' => {
499499
'FOOonetwO', 'method, .&(2args), method, .& with whatever curry, .&sub';
500500
}
501501

502+
subtest 'can .assuming with WhateverCode' => {
503+
plan 4;
504+
is-deeply ((*.flip)).assuming(42)(), '24', '1-param, 1 assumed';
505+
is-deeply ((* + *)).assuming(42)(3), 45, '2-param, 1 assumed';
506+
is-deeply ((* + *)).assuming(42, 5)(), 47, '2-param, 2 assumed';
507+
is-deeply ((* + * + *.flip + *.abs)).assuming(42, 5)(123, -50), 418,
508+
'5-params with nested calls, 2 assumed';
509+
}
510+
502511
# vim: ft=perl6

0 commit comments

Comments
 (0)