Skip to content

Commit dbe43e1

Browse files
committed
Test we don't curry HyperWhatever:Us
RT#128880: https://rt.perl.org/Ticket/Display.html?id=128880 R#1489: rakudo/rakudo#1489 Rakudo fix: rakudo/rakudo@57a1aa7a87
1 parent ceed491 commit dbe43e1

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

S02-types/hyperwhatever.t

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
use v6;
2+
use Test;
3+
4+
# Tests for the HyperWhatever type and its curries
5+
6+
plan 2;
7+
8+
# RT#128880
9+
throws-like HyperWhatever.new, X::Cannot::New,
10+
'.new throws that it cannot be called';
11+
12+
# https://github.com/rakudo/rakudo/issues/1489
13+
subtest 'smartmatch with HyperWhatever type object' => {
14+
plan 6;
15+
is-deeply (HyperWhatever ~~ HyperWhatever), True, 'HW (true)';
16+
is-deeply (42 ~~ HyperWhatever), False, 'HW (false)';
17+
is-deeply (HyperWhatever ~~ HyperWhatever:U), True, 'HW:U (true)';
18+
is-deeply ('meows' ~~ HyperWhatever:U), False, 'HW:U (false)';
19+
is-deeply (((**)) ~~ HyperWhatever:D), True, 'HW:D (true)';
20+
is-deeply (((*)) ~~ HyperWhatever:D), False, 'HW:D (false)';
21+
}
22+
23+
24+
# vim: ft=perl6

0 commit comments

Comments
 (0)