Merge pull request #548 from bocoup/random-fp

Avoid false positives
This commit is contained in:
Leo Balter 2016-03-24 10:49:44 -04:00
commit 35b93bb5c2
1 changed files with 6 additions and 0 deletions

View File

@ -15,6 +15,12 @@ description: >
for (var i = 0; i < 100; i++)
{
var val = Math.random();
assert.sameValue(
typeof val, 'number', 'should not produce a non-numeric value: ' + val
);
assert.notSameValue(val, NaN, 'should not produce NaN');
if (val < 0 || val >= 1)
{
$ERROR("#1: Math.random() = " + val);