Skip to content

Commit

Permalink
<=> with non-numerics throws correct exception
Browse files Browse the repository at this point in the history
  • Loading branch information
zoffixznet committed Sep 10, 2016
1 parent 2c617ab commit bb4d3eb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion S03-operators/spaceship.t
Expand Up @@ -4,7 +4,7 @@ use Test;

# L<S03/Nonchaining binary precedence/Sort comparisons>

plan 5;
plan 6;

my %ball = map {; $_ => 1 }, 1..12;
is(
Expand All @@ -26,4 +26,8 @@ is($result_3, Order::Less, 'When spaceship terms are non-trivial members it pars
%ball{12} = 0.5;
is(%ball{12} <=> %ball{11}, Order::Less, 'When spaceship terms are non-integral numbers it parses incorrectly');

# RT #126536
throws-like { say ’a‘ <=> ’b‘ }, X::Str::Numeric,
'<=> with non-numerics throws correct exception';

# vim: ft=perl6

0 comments on commit bb4d3eb

Please sign in to comment.