Skip to content

Commit 4954f24

Browse files
committed
Test numifying 'NaN', 'Inf', '-Inf' and '+Inf'
1 parent 02bdfce commit 4954f24

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

t/nqp/109-coercions.t

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
plan(4);
2+
3+
my sub isnan($n) {
4+
nqp::isnanorinf($n) && $n != nqp::inf() && $n != nqp::neginf();
5+
}
6+
7+
ok(isnan(+'NaN'), 'numifying NaN');
8+
ok(+'Inf' == nqp::inf, 'numifying Inf');
9+
ok(+'+Inf' == nqp::inf, 'numifying +Inf');
10+
ok(+'-Inf' == nqp::neginf, 'numifying -Inf');

0 commit comments

Comments
 (0)