Skip to content

Commit

Permalink
Test conversion of numbers with unicode minus sign
Browse files Browse the repository at this point in the history
  • Loading branch information
pmurias committed Sep 4, 2018
1 parent 9c0a7c3 commit eb0c5c0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion t/nqp/109-coercions.t
@@ -1,4 +1,4 @@
plan(18);
plan(21);

my sub isnan($n) {
nqp::isnanorinf($n) && $n != nqp::inf() && $n != nqp::neginf();
Expand All @@ -8,8 +8,12 @@ ok(isnan(+'NaN'), 'numifying NaN');
ok(+'Inf' == nqp::inf, 'numifying Inf');
ok(+'+Inf' == nqp::inf, 'numifying +Inf');
ok(+'-Inf' == nqp::neginf, 'numifying -Inf');
ok(+'−Inf' == nqp::neginf, 'numifying −Inf');
ok(+'3.14159_26535' == 3.1415926535, 'numifying works with underscores');
ok(+'−123e0' == -123, 'numifying works with unicode minus U+2212');
is(+'1230E−1', 123, 'numifying works with 1230E−1');
is(+'−1230E−1', -123, 'numifying works with −1230E−1');

is(~100, '100', 'stringifing 100');
is(~100.0, '100', 'stringifing 100');
ok(~3.14 == 3.14, 'stringifing 3.14');
Expand Down

0 comments on commit eb0c5c0

Please sign in to comment.