| Index: LayoutTests/fast/js/script-tests/number-toprecision.js
|
| diff --git a/LayoutTests/fast/js/script-tests/number-toprecision.js b/LayoutTests/fast/js/script-tests/number-toprecision.js
|
| deleted file mode 100644
|
| index a3f5b04bc11b486442212d2e1f4e23ca87246671..0000000000000000000000000000000000000000
|
| --- a/LayoutTests/fast/js/script-tests/number-toprecision.js
|
| +++ /dev/null
|
| @@ -1,42 +0,0 @@
|
| -description(
|
| - 'This test checks a few Number.toPrecision cases, including ' +
|
| - '<a href="http://bugs.webkit.org/show_bug.cgi?id=15145">15145: (0.999).toPrecision(1) returns incorrect result</a>' +
|
| - '.');
|
| -
|
| -shouldBeEqualToString("(0.999).toPrecision(1)", "1");
|
| -shouldBeEqualToString("(0.999).toPrecision(2)", "1.0");
|
| -shouldBeEqualToString("(0.999).toPrecision(3)", "0.999");
|
| -
|
| -var posInf = 1/0;
|
| -var negInf = -1/0;
|
| -var nan = 0/0;
|
| -
|
| -shouldBeEqualToString("(0.0).toPrecision(4)", "0.000");
|
| -shouldBeEqualToString("(-0.0).toPrecision(4)", "0.000");
|
| -shouldBeEqualToString("(0.0).toPrecision()", "0");
|
| -shouldBeEqualToString("(-0.0).toPrecision()", "0");
|
| -shouldBeEqualToString("(1234.567).toPrecision()", "1234.567");
|
| -shouldThrow("(1234.567).toPrecision(0)");
|
| -shouldThrow("(1234.567).toPrecision(null)"); // just like 0
|
| -shouldThrow("(1234.567).toPrecision(false)"); // just like 0
|
| -shouldThrow("(1234.567).toPrecision('foo')"); // just like 0
|
| -shouldThrow("(1234.567).toPrecision(-1)");
|
| -shouldBeEqualToString("(1234.567).toPrecision(1)", "1e+3");
|
| -shouldBeEqualToString("(1234.567).toPrecision(true)", "1e+3"); // just like 1
|
| -shouldBeEqualToString("(1234.567).toPrecision('1')", "1e+3"); // just like 1
|
| -shouldBeEqualToString("(1234.567).toPrecision(2)", "1.2e+3");
|
| -shouldBeEqualToString("(1234.567).toPrecision(2.9)", "1.2e+3");
|
| -shouldBeEqualToString("(1234.567).toPrecision(5)", "1234.6");
|
| -shouldBeEqualToString("(1234.567).toPrecision(21)", "1234.56700000000000728");
|
| -// SpiderMonkey allows precision values 1 to 100, we implement the spec and only allow 1 to 21.
|
| -shouldThrow("(1234.567).toPrecision(22)");
|
| -shouldThrow("(1234.567).toPrecision(100)");
|
| -shouldThrow("(1234.567).toPrecision(101)");
|
| -
|
| -shouldThrow("(1234.567).toPrecision(posInf)");
|
| -shouldThrow("(1234.567).toPrecision(negInf)");
|
| -shouldThrow("(1234.567).toPrecision(nan)"); // nan is treated like 0
|
| -
|
| -shouldBeEqualToString("posInf.toPrecision()", "Infinity");
|
| -shouldBeEqualToString("negInf.toPrecision()", "-Infinity");
|
| -shouldBeEqualToString("nan.toPrecision()", "NaN");
|
|
|