Skip to content

Commit

Permalink
Test we can handle fancy unicode nums
Browse files Browse the repository at this point in the history
  • Loading branch information
zoffixznet authored and AlexDaniel committed Apr 28, 2018
1 parent 619bf68 commit 9e4edf9
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion t/nqp/115-nums.t
@@ -1,4 +1,4 @@
plan(8 + 3*300);
plan(14 + 3*300);

# Precision and value drift tests for floating point numerics

Expand Down Expand Up @@ -29,6 +29,25 @@ is( 3e-324, 5e-324, '2e-324 denormal equates to 5e-324 denormal');
is( 2e-324, 0e0, '2e-324 denormal is 0e0');
is( 9e-324, 1e-323, '9e-324 denormal is 1e-323');


# U+0CE6 KANNADA DIGIT ZERO [Nd] (೦)
# U+0CE7 KANNADA DIGIT ONE [Nd] (೧)
# U+0CE8 KANNADA DIGIT TWO [Nd] (೨)
# U+0CE9 KANNADA DIGIT THREE [Nd] (೩)
# U+0CEA KANNADA DIGIT FOUR [Nd] (೪)
# U+0CEB KANNADA DIGIT FIVE [Nd] (೫)
# U+0CEC KANNADA DIGIT SIX [Nd] (೬)
# U+0CED KANNADA DIGIT SEVEN [Nd] (೭)
# U+0CEE KANNADA DIGIT EIGHT [Nd] (೮)
# U+0CEF KANNADA DIGIT NINE [Nd] (೯)

isn't(೫e-೩೨೪, ೦e೦, 'denormal 5e-324 is recognized and is not 0 (Uni)');
is( ೬e-೩೨೪, ೫e-೩೨೪, '6e-324 denormal equates to 5e-324 denormal (Uni)');
is( ೫e-೩೨೪, ೫e-೩೨೪, '5e-324 denormal equates to 5e-324 denormal (Uni)');
is( ೩e-೩೨೪, ೫e-೩೨೪, '2e-324 denormal equates to 5e-324 denormal (Uni)');
is( ೨e-೩೨೪, ೦e೦, '2e-324 denormal is 0e0 (Uni)');
is( ೯e-೩೨೪, ೧e-೩೨೩, '9e-324 denormal is 1e-323 (Uni)');

isn't(1180591620717411303424e0, 1180591620717409992704e0,
'distinct num literals close to each other are not equal');

Expand Down

0 comments on commit 9e4edf9

Please sign in to comment.