mirror of
https://github.com/tc39/test262.git
synced 2025-09-24 10:38:30 +02:00
Remove print calls in sm/Number
This commit is contained in:
parent
c92f4924fa
commit
1211b7805a
@ -8,18 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
|
|||||||
flags:
|
flags:
|
||||||
- noStrict
|
- noStrict
|
||||||
description: |
|
description: |
|
||||||
pending
|
'0x' not followed by hex digits should be a syntax error
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
var BUGNUMBER = 582643;
|
|
||||||
var summary = "'0x' not followed by hex digits should be a syntax error";
|
|
||||||
|
|
||||||
print(BUGNUMBER + ": " + summary);
|
|
||||||
|
|
||||||
/**************
|
|
||||||
* BEGIN TEST *
|
|
||||||
**************/
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -31,7 +22,3 @@ catch (e)
|
|||||||
assert.sameValue(e instanceof SyntaxError, true,
|
assert.sameValue(e instanceof SyntaxError, true,
|
||||||
"bad exception thrown: " + e);
|
"bad exception thrown: " + e);
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************/
|
|
||||||
|
|
||||||
print("All tests passed!");
|
|
||||||
|
@ -8,18 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
|
|||||||
flags:
|
flags:
|
||||||
- noStrict
|
- noStrict
|
||||||
description: |
|
description: |
|
||||||
pending
|
Number.EPSILON
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
var BUGNUMBER = 885798;
|
|
||||||
var summary = "ES6 (draft May 2013) 15.7.3.7 Number.EPSILON";
|
|
||||||
|
|
||||||
print(BUGNUMBER + ": " + summary);
|
|
||||||
|
|
||||||
/**************
|
|
||||||
* BEGIN TEST *
|
|
||||||
**************/
|
|
||||||
|
|
||||||
// Test value
|
// Test value
|
||||||
assert.sameValue(Number.EPSILON, Math.pow(2, -52));
|
assert.sameValue(Number.EPSILON, Math.pow(2, -52));
|
||||||
@ -29,4 +20,3 @@ var descriptor = Object.getOwnPropertyDescriptor(Number, 'EPSILON');
|
|||||||
assert.sameValue(descriptor.writable, false);
|
assert.sameValue(descriptor.writable, false);
|
||||||
assert.sameValue(descriptor.configurable, false);
|
assert.sameValue(descriptor.configurable, false);
|
||||||
assert.sameValue(descriptor.enumerable, false);
|
assert.sameValue(descriptor.enumerable, false);
|
||||||
|
|
||||||
|
@ -8,19 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
|
|||||||
flags:
|
flags:
|
||||||
- noStrict
|
- noStrict
|
||||||
description: |
|
description: |
|
||||||
pending
|
Number.MIN_SAFE_INTEGER
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
var BUGNUMBER = 885798;
|
|
||||||
var summary = "ES6 (draft April 2014) 20.1.2.10 Number.MIN_SAFE_INTEGER";
|
|
||||||
|
|
||||||
print(BUGNUMBER + ": " + summary);
|
|
||||||
|
|
||||||
/**************
|
|
||||||
* BEGIN TEST *
|
|
||||||
**************/
|
|
||||||
|
|
||||||
// Test value
|
// Test value
|
||||||
assert.sameValue(Number.MIN_SAFE_INTEGER, -(Math.pow(2, 53) - 1));
|
assert.sameValue(Number.MIN_SAFE_INTEGER, -(Math.pow(2, 53) - 1));
|
||||||
@ -31,4 +21,3 @@ var descriptor = Object.getOwnPropertyDescriptor(Number, 'MIN_SAFE_INTEGER');
|
|||||||
assert.sameValue(descriptor.writable, false);
|
assert.sameValue(descriptor.writable, false);
|
||||||
assert.sameValue(descriptor.configurable, false);
|
assert.sameValue(descriptor.configurable, false);
|
||||||
assert.sameValue(descriptor.enumerable, false);
|
assert.sameValue(descriptor.enumerable, false);
|
||||||
|
|
||||||
|
@ -8,19 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
|
|||||||
flags:
|
flags:
|
||||||
- noStrict
|
- noStrict
|
||||||
description: |
|
description: |
|
||||||
pending
|
Number.MAX_SAFE_INTEGER
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
var BUGNUMBER = 885798;
|
|
||||||
var summary = "ES6 (draft April 2014) 20.1.2.6 Number.MAX_SAFE_INTEGER";
|
|
||||||
|
|
||||||
print(BUGNUMBER + ": " + summary);
|
|
||||||
|
|
||||||
/**************
|
|
||||||
* BEGIN TEST *
|
|
||||||
**************/
|
|
||||||
|
|
||||||
// Test value
|
// Test value
|
||||||
assert.sameValue(Number.MAX_SAFE_INTEGER, Math.pow(2, 53) - 1);
|
assert.sameValue(Number.MAX_SAFE_INTEGER, Math.pow(2, 53) - 1);
|
||||||
@ -31,4 +21,3 @@ var descriptor = Object.getOwnPropertyDescriptor(Number, 'MAX_SAFE_INTEGER');
|
|||||||
assert.sameValue(descriptor.writable, false);
|
assert.sameValue(descriptor.writable, false);
|
||||||
assert.sameValue(descriptor.configurable, false);
|
assert.sameValue(descriptor.configurable, false);
|
||||||
assert.sameValue(descriptor.enumerable, false);
|
assert.sameValue(descriptor.enumerable, false);
|
||||||
|
|
||||||
|
@ -8,19 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
|
|||||||
flags:
|
flags:
|
||||||
- noStrict
|
- noStrict
|
||||||
description: |
|
description: |
|
||||||
pending
|
Number.prototype.toExponential
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
var BUGNUMBER = 818617;
|
|
||||||
var summary = "ECMAScript 2017 Draft ECMA-262 Section 20.1.3.2: Number.prototype.toExponential";
|
|
||||||
|
|
||||||
print(BUGNUMBER + ": " + summary);
|
|
||||||
|
|
||||||
/**************
|
|
||||||
* BEGIN TEST *
|
|
||||||
**************/
|
|
||||||
|
|
||||||
// With NaN, fractionDigits out of range.
|
// With NaN, fractionDigits out of range.
|
||||||
assert.sameValue(Number.prototype.toExponential.call(NaN, 555), 'NaN');
|
assert.sameValue(Number.prototype.toExponential.call(NaN, 555), 'NaN');
|
||||||
@ -52,7 +42,3 @@ assertThrowsValue(
|
|||||||
|
|
||||||
// Not a number throws TypeError
|
// Not a number throws TypeError
|
||||||
assert.throws(TypeError, () => Number.prototype.toExponential.call("Hello"));
|
assert.throws(TypeError, () => Number.prototype.toExponential.call("Hello"));
|
||||||
|
|
||||||
if (typeof assert.sameValue === "function") {
|
|
||||||
}
|
|
||||||
|
|
||||||
|
@ -8,19 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
|
|||||||
flags:
|
flags:
|
||||||
- noStrict
|
- noStrict
|
||||||
description: |
|
description: |
|
||||||
pending
|
Number.prototype.toPrecision
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
var BUGNUMBER = 818617;
|
|
||||||
var summary = "ECMAScript 2017 Draft ECMA-262 Section 20.1.3.5: Number.prototype.toPrecision";
|
|
||||||
|
|
||||||
print(BUGNUMBER + ": " + summary);
|
|
||||||
|
|
||||||
/**************
|
|
||||||
* BEGIN TEST *
|
|
||||||
**************/
|
|
||||||
|
|
||||||
// With NaN, fractionDigits out of range.
|
// With NaN, fractionDigits out of range.
|
||||||
assert.sameValue(Number.prototype.toPrecision.call(NaN, 555), 'NaN');
|
assert.sameValue(Number.prototype.toPrecision.call(NaN, 555), 'NaN');
|
||||||
@ -52,7 +42,3 @@ assertThrowsValue(
|
|||||||
|
|
||||||
// Not a number throws TypeError
|
// Not a number throws TypeError
|
||||||
assert.throws(TypeError, () => Number.prototype.toPrecision.call("Hello"));
|
assert.throws(TypeError, () => Number.prototype.toPrecision.call("Hello"));
|
||||||
|
|
||||||
if (typeof assert.sameValue === "function") {
|
|
||||||
}
|
|
||||||
|
|
||||||
|
@ -8,18 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
|
|||||||
flags:
|
flags:
|
||||||
- noStrict
|
- noStrict
|
||||||
description: |
|
description: |
|
||||||
pending
|
Number.prototype.to* should throw a RangeError when passed a bad precision
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
var BUGNUMBER = 795745;
|
|
||||||
var summary =
|
|
||||||
"Number.prototype.to* should throw a RangeError when passed a bad precision";
|
|
||||||
|
|
||||||
print(BUGNUMBER + ": " + summary);
|
|
||||||
|
|
||||||
/**************
|
|
||||||
* BEGIN TEST *
|
|
||||||
**************/
|
|
||||||
|
|
||||||
function test(method, prec)
|
function test(method, prec)
|
||||||
{
|
{
|
||||||
@ -45,7 +36,3 @@ test("toFixed", 9999999);
|
|||||||
test("toPrecision", 9999999);
|
test("toPrecision", 9999999);
|
||||||
|
|
||||||
test("toPrecision", 0);
|
test("toPrecision", 0);
|
||||||
|
|
||||||
/******************************************************************************/
|
|
||||||
|
|
||||||
print("Tests complete");
|
|
||||||
|
@ -8,19 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
|
|||||||
flags:
|
flags:
|
||||||
- noStrict
|
- noStrict
|
||||||
description: |
|
description: |
|
||||||
pending
|
[[DefaultValue]] behavior wrong for Number with overridden valueOf/toString
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
var BUGNUMBER = 645464;
|
|
||||||
var summary =
|
|
||||||
"[[DefaultValue]] behavior wrong for Number with overridden valueOf/toString";
|
|
||||||
|
|
||||||
print(BUGNUMBER + ": " + summary);
|
|
||||||
|
|
||||||
/**************
|
|
||||||
* BEGIN TEST *
|
|
||||||
**************/
|
|
||||||
|
|
||||||
|
|
||||||
// equality
|
// equality
|
||||||
|
|
||||||
@ -169,7 +159,3 @@ function testInOperatorName()
|
|||||||
assert.sameValue(n3 in { 0: 17 }, true);
|
assert.sameValue(n3 in { 0: 17 }, true);
|
||||||
}
|
}
|
||||||
testInOperatorName();
|
testInOperatorName();
|
||||||
|
|
||||||
/******************************************************************************/
|
|
||||||
|
|
||||||
print("All tests passed!");
|
|
||||||
|
@ -8,14 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
|
|||||||
flags:
|
flags:
|
||||||
- noStrict
|
- noStrict
|
||||||
description: |
|
description: |
|
||||||
pending
|
Number.isSafeInteger(number)
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
var BUGNUMBER = 1003764;
|
|
||||||
var summary = "ES6 (draft Draft May 22, 2014) ES6 20.1.2.5 Number.isSafeInteger(number)";
|
|
||||||
|
|
||||||
print(BUGNUMBER + ": " + summary);
|
|
||||||
|
|
||||||
assert.sameValue(Number.isSafeInteger.length, 1);
|
assert.sameValue(Number.isSafeInteger.length, 1);
|
||||||
|
|
||||||
@ -42,6 +37,3 @@ assert.sameValue(Number.isSafeInteger(-Math.pow(2, 53) - 1), false);
|
|||||||
assert.sameValue(Number.isSafeInteger(-Math.pow(2, 53)), false);
|
assert.sameValue(Number.isSafeInteger(-Math.pow(2, 53)), false);
|
||||||
assert.sameValue(Number.isSafeInteger(-Math.pow(2, 53) + 1), true);
|
assert.sameValue(Number.isSafeInteger(-Math.pow(2, 53) + 1), true);
|
||||||
assert.sameValue(Number.isSafeInteger(-Math.pow(2, 53) + 2), true);
|
assert.sameValue(Number.isSafeInteger(-Math.pow(2, 53) + 2), true);
|
||||||
|
|
||||||
|
|
||||||
print("All tests passed!");
|
|
||||||
|
@ -8,14 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
|
|||||||
flags:
|
flags:
|
||||||
- noStrict
|
- noStrict
|
||||||
description: |
|
description: |
|
||||||
pending
|
Number.parseFloat(string)
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
var BUGNUMBER = 886949;
|
|
||||||
var summary = "ES6 (draft May 2013) 15.7.3.10 Number.parseFloat(string)";
|
|
||||||
|
|
||||||
print(BUGNUMBER + ": " + summary);
|
|
||||||
|
|
||||||
assert.sameValue(Number.parseFloat("Infinity"), Infinity);
|
assert.sameValue(Number.parseFloat("Infinity"), Infinity);
|
||||||
assert.sameValue(Number.parseFloat("+Infinity"), Infinity);
|
assert.sameValue(Number.parseFloat("+Infinity"), Infinity);
|
||||||
@ -30,5 +25,3 @@ assert.sameValue(Number.parseFloat("NaN"), NaN);
|
|||||||
|
|
||||||
/* Number.parseFloat should be the same function object as global parseFloat. */
|
/* Number.parseFloat should be the same function object as global parseFloat. */
|
||||||
assert.sameValue(Number.parseFloat, parseFloat);
|
assert.sameValue(Number.parseFloat, parseFloat);
|
||||||
|
|
||||||
print("All tests passed!");
|
|
||||||
|
@ -8,18 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
|
|||||||
flags:
|
flags:
|
||||||
- noStrict
|
- noStrict
|
||||||
description: |
|
description: |
|
||||||
pending
|
Number.parseInt(string, radix)
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
var BUGNUMBER = 886949;
|
|
||||||
var summary = "ES6 (draft May 2013) 15.7.3.9 Number.parseInt(string, radix)";
|
|
||||||
|
|
||||||
print(BUGNUMBER + ": " + summary);
|
|
||||||
|
|
||||||
/**************
|
|
||||||
* BEGIN TEST *
|
|
||||||
**************/
|
|
||||||
|
|
||||||
var str, radix;
|
var str, radix;
|
||||||
var upvar;
|
var upvar;
|
||||||
@ -173,7 +164,3 @@ assert.sameValue(Number.parseInt("00A", 17), 10);
|
|||||||
|
|
||||||
/* Number.parseInt should be the same function object as global parseInt. */
|
/* Number.parseInt should be the same function object as global parseInt. */
|
||||||
assert.sameValue(Number.parseInt, parseInt);
|
assert.sameValue(Number.parseInt, parseInt);
|
||||||
|
|
||||||
/******************************************************************************/
|
|
||||||
|
|
||||||
print("All tests passed!");
|
|
||||||
|
@ -8,19 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
|
|||||||
flags:
|
flags:
|
||||||
- noStrict
|
- noStrict
|
||||||
description: |
|
description: |
|
||||||
pending
|
Number.parseInt(string, radix). Verify that Number.parseInt defaults to decimal.
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
var BUGNUMBER = 886949;
|
|
||||||
var summary = "ES6 (draft May 2013) 15.7.3.9 Number.parseInt(string, radix)." +
|
|
||||||
" Verify that Number.parseInt defaults to decimal.";
|
|
||||||
|
|
||||||
print(BUGNUMBER + ": " + summary);
|
|
||||||
|
|
||||||
/**************
|
|
||||||
* BEGIN TEST *
|
|
||||||
**************/
|
|
||||||
|
|
||||||
assert.sameValue(Number.parseInt("08"), 8);
|
assert.sameValue(Number.parseInt("08"), 8);
|
||||||
assert.sameValue(Number.parseInt("09"), 9);
|
assert.sameValue(Number.parseInt("09"), 9);
|
||||||
@ -31,7 +21,3 @@ function strictParseInt(s) { "use strict"; return Number.parseInt(s); }
|
|||||||
assert.sameValue(strictParseInt("08"), 8);
|
assert.sameValue(strictParseInt("08"), 8);
|
||||||
assert.sameValue(strictParseInt("09"), 9);
|
assert.sameValue(strictParseInt("09"), 9);
|
||||||
assert.sameValue(strictParseInt("014"), 14);
|
assert.sameValue(strictParseInt("014"), 14);
|
||||||
|
|
||||||
/******************************************************************************/
|
|
||||||
|
|
||||||
print("All tests passed!");
|
|
||||||
|
@ -8,19 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
|
|||||||
flags:
|
flags:
|
||||||
- noStrict
|
- noStrict
|
||||||
description: |
|
description: |
|
||||||
pending
|
Number.prototype.toString should use ToInteger on the radix and should throw a RangeError if the radix is bad
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
var BUGNUMBER = 647385;
|
|
||||||
var summary =
|
|
||||||
"Number.prototype.toString should use ToInteger on the radix and should " +
|
|
||||||
"throw a RangeError if the radix is bad";
|
|
||||||
|
|
||||||
print(BUGNUMBER + ": " + summary);
|
|
||||||
|
|
||||||
/**************
|
|
||||||
* BEGIN TEST *
|
|
||||||
**************/
|
|
||||||
|
|
||||||
function test(r)
|
function test(r)
|
||||||
{
|
{
|
||||||
@ -36,7 +26,3 @@ function test(r)
|
|||||||
}
|
}
|
||||||
test(Math.pow(2, 32) + 10);
|
test(Math.pow(2, 32) + 10);
|
||||||
test(55);
|
test(55);
|
||||||
|
|
||||||
/******************************************************************************/
|
|
||||||
|
|
||||||
print("All tests passed!");
|
|
||||||
|
@ -8,17 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
|
|||||||
flags:
|
flags:
|
||||||
- noStrict
|
- noStrict
|
||||||
description: |
|
description: |
|
||||||
pending
|
Various tests of ToNumber(string), particularly +"0x" being NaN
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
var BUGNUMBER = 872853;
|
|
||||||
var summary = 'Various tests of ToNumber(string), particularly +"0x" being NaN';
|
|
||||||
|
|
||||||
print(BUGNUMBER + ": " + summary);
|
|
||||||
|
|
||||||
/**************
|
|
||||||
* BEGIN TEST *
|
|
||||||
**************/
|
|
||||||
|
|
||||||
assert.sameValue(+"0x", NaN);
|
assert.sameValue(+"0x", NaN);
|
||||||
assert.sameValue(+"\t0x", NaN);
|
assert.sameValue(+"\t0x", NaN);
|
||||||
@ -37,7 +29,3 @@ assert.sameValue(+"\t+Infinity", Infinity);
|
|||||||
assert.sameValue(+"-Infinity\n", -Infinity);
|
assert.sameValue(+"-Infinity\n", -Infinity);
|
||||||
assert.sameValue(+"+ Infinity", NaN);
|
assert.sameValue(+"+ Infinity", NaN);
|
||||||
assert.sameValue(+"- Infinity", NaN);
|
assert.sameValue(+"- Infinity", NaN);
|
||||||
|
|
||||||
/******************************************************************************/
|
|
||||||
|
|
||||||
print("Tests complete");
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user