summaryrefslogtreecommitdiffstats
path: root/js/src/tests/ecma_5/Global/parseFloat-01.js
blob: 089c0901ec753f18e96fdb26a650ec8d980f01b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Any copyright is dedicated to the Public Domain.
// http://creativecommons.org/licenses/publicdomain/

//-----------------------------------------------------------------------------
var BUGNUMBER = 613492;
var summary = "ES5 15.1.2.3 parseFloat(string)";

print(BUGNUMBER + ": " + summary);

assertEq(parseFloat("Infinity"), Infinity);
assertEq(parseFloat("+Infinity"), Infinity);
assertEq(parseFloat("-Infinity"), -Infinity);

assertEq(parseFloat("inf"), NaN);
assertEq(parseFloat("Inf"), NaN);
assertEq(parseFloat("infinity"), NaN);

assertEq(parseFloat("nan"), NaN);
assertEq(parseFloat("NaN"), NaN);

if (typeof reportCompare === "function")
  reportCompare(true, true);

print("All tests passed!");