Skip to content

Commit f94554a

Browse files
Kodi ArferKodi Arfer
authored andcommitted
[whatever.t] Added tests for RT #80256.
1 parent 38439ef commit f94554a

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

S02-builtin_data_types/whatever.t

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use v6;
22
use Test;
33

4-
plan 62;
4+
plan 71;
55

66
# L<S02/Built-In Data Types/"The * character as a standalone term captures the notion of">
77
# L<S02/Native types/"If any native type is explicitly initialized to">
@@ -206,6 +206,23 @@ is (0,0,0,0,0,0) >>+>> ((1,2) xx *), <1 2 1 2 1 2>, 'xx * works';
206206
# RT #73162
207207
eval_lives_ok '{*.{}}()', '{*.{}}() lives';
208208

209+
# RT #80256
210+
{
211+
my $f = * !< 3;
212+
isa_ok $f, Code, 'Whatever-currying !< (1)';
213+
nok $f(2), 'Whatever-currying !< (2)';
214+
ok $f(3), 'Whatever-currying !< (3)';
215+
ok $f(4), 'Whatever-currying !< (4)';
216+
217+
$f = 5 R- *;
218+
isa_ok $f, Code, 'Whatever-currying with R- (1)';
219+
is $f(7), 2, 'Whatever-currying with R- (2)';
220+
is $f(0), -5, 'Whatever-currying with R- (3)';
221+
222+
dies_ok { &infix:<+>(*, 42) }, '&infix:<+>(*, 42) doesn\'t make a closure';
223+
dies_ok { &infix:<R+>(*, 42) }, '&infix:<+>(*, 42) doesn\'t make a closure';
224+
}
225+
209226
done_testing;
210227

211228
# vim: ft=perl6

0 commit comments

Comments
 (0)