Skip to content

Commit 8a8bd60

Browse files
committed
smartmathing :U numeric against :D numeric does not throw
Tests for issue fixed by rakudo/rakudo@84b7ebdf42
1 parent 18e3964 commit 8a8bd60

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

S32-num/int.t

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use v6;
22
use Test;
3-
plan 107;
3+
plan 108;
44

55
# L<S32::Numeric/Real/=item truncate>
66
# truncate and .Int are synonynms.
@@ -137,4 +137,16 @@ is (-128).msb, 7, "(-128).msb is 7"; # 1000 0000
137137
is (-129).msb, 8, "(-129).msb is 8";
138138
is (-32768).msb, 15, "(-32768).msb is 15";
139139

140+
# Test issue fixed by https://github.com/rakudo/rakudo/commit/84b7ebdf42
141+
subtest 'smartmathing :U numeric against :D numeric does not throw' => {
142+
plan 15;
143+
for 42, τ, ½ -> $what {
144+
is (Numeric ~~ $what), False, "Numeric:U ~~ $what ($what.^name())";
145+
is (Int ~~ $what), False, "Int:U ~~ $what ($what.^name())";
146+
is (UInt ~~ $what), False, "UInt:U ~~ $what ($what.^name())";
147+
is (Num ~~ $what), False, "Num:U ~~ $what ($what.^name())";
148+
is (Rat ~~ $what), False, "Rat:U ~~ $what ($what.^name())";
149+
}
150+
}
151+
140152
# vim: ft=perl6

0 commit comments

Comments
 (0)