Skip to content

Commit

Permalink
[v6.d REVIEW] Int <- Int/NaN don't test exact message content
Browse files Browse the repository at this point in the history
Orig: 679a57fd8
  • Loading branch information
zoffixznet committed Jan 2, 2018
1 parent 932d7c6 commit be311ff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions S02-types/infinity.t
Expand Up @@ -67,8 +67,8 @@ ok truncate(Inf) ~~ Inf, 'truncate(Inf) ~~ Inf';
{
#RT #126990
throws-like { my Int $x = Inf }, X::TypeCheck::Assignment,
message => /'expected Int but got Num (Inf)'/,
"trying to assign Inf to Int gives a helpful error";
:got(Inf), :expected(Int),
'trying to assign Inf to Int gives a helpful error';

my Num $x = Inf;
is $x, Inf, 'assigning Inf to Num works without errors';
Expand Down
4 changes: 2 additions & 2 deletions S02-types/nan.t
Expand Up @@ -44,8 +44,8 @@ ok (my num $ = NaN) === (my num $ = NaN), "NaN value identity (native num)";
{
#RT #126990
throws-like { my Int $x = NaN }, X::TypeCheck::Assignment,
message => /'expected Int but got Num (NaN)'/,
"trying to assign NaN to Int gives a helpful error";
:got(NaN), :expected(Int),
'trying to assign NaN to Int gives a helpful error';

my Num $x = NaN;
is $x, NaN, 'assigning NaN to Num works without errors';
Expand Down

0 comments on commit be311ff

Please sign in to comment.