Skip to content

Commit 860dc71

Browse files
committed
Test subclass of NaN !=== a NaN
RT#129002: https://rt.perl.org/Ticket/Display.html?id=129002
1 parent 522a9c7 commit 860dc71

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

S02-types/nan.t

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use v6;
22

33
use Test;
44

5-
plan 24;
5+
plan 26;
66

77
# Undeterminate Math results
88
# see L<"http://mathworld.wolfram.com/Indeterminate.html">
@@ -55,5 +55,10 @@ ok (my num $ = NaN) === (my num $ = NaN), "NaN value identity (native num)";
5555
is $x, NaN, 'assigning NaN to Num works without errors';
5656
}
5757

58+
{ # RT #129002
59+
my $mynan = my class MyNum is Num {}.new(NaN);
60+
is-deeply $mynan == NaN, False, 'sublcass of NaN !== NaN';
61+
is-deeply $mynan === NaN, False, 'sublcass of NaN !=== NaN';
62+
}
5863

5964
# vim: ft=perl6

0 commit comments

Comments
 (0)