Skip to content

Commit 0a0fa6d

Browse files
committed
Add test to check UInt on non-numeric Str returns a Failure
1 parent 48bd861 commit 0a0fa6d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

S32-str/numeric.t

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

55
#?DOES 2
66
sub check($str, $expected_type, $expected_number, $desc?) {
@@ -171,6 +171,10 @@ throws-like Q|"34\x[308]5".Int|, X::Str::Numeric,
171171
dies-ok { $n * 2 }, 'cannot do math with a Failure';
172172
}
173173

174+
# https://github.com/rakudo/rakudo/pull/3289
175+
fails-like { 'a'.UInt }, X::Str::Numeric,
176+
'"a".UInt produces a Failure';
177+
174178
subtest 'can handle − (U+2212) minus as regular minus' => {
175179
plan 4;
176180
is-deeply +'−42', -42, 'Int';

0 commit comments

Comments
 (0)