mirror of https://github.com/tc39/test262.git
Merge pull request #269 from suwc/Math_builtins
Add new tests for Math built-ins
This commit is contained in:
commit
b56af07567
|
@ -0,0 +1,35 @@
|
|||
// Copyright 2015 Microsoft Corporation. All rights reserved.
|
||||
// This code is governed by the license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
description: Math.Log2 with sample values.
|
||||
includes: [assert.js]
|
||||
es6id: 20.2.2.23
|
||||
---*/
|
||||
|
||||
assert.sameValue(Math.log2(-0), Number.NEGATIVE_INFINITY,
|
||||
"Math.log2 produces incorrect output for -0");
|
||||
assert.sameValue(Math.log2(+0), Number.NEGATIVE_INFINITY,
|
||||
"Math.log2 produces incorrect output for +0");
|
||||
assert.sameValue(Math.log2(-0.9), NaN,
|
||||
"Math.log2 produces incorrect output for -0.9");
|
||||
assert.sameValue(Math.log2(NaN), NaN,
|
||||
"Math.log2 produces incorrect output for NaN");
|
||||
assert.sameValue(Math.log2(-10), NaN,
|
||||
"Math.log2 produces incorrect output for -10");
|
||||
assert.sameValue(Math.log2(-Infinity), NaN,
|
||||
"Math.log2 produces incorrect output for -Infinity");
|
||||
assert.sameValue(Math.log2(null), Number.NEGATIVE_INFINITY,
|
||||
"Math.log2 produces incorrect output for null");
|
||||
assert.sameValue(Math.log2(undefined), NaN,
|
||||
"Math.log2 produces incorrect output for undefined");
|
||||
assert.sameValue(Math.log2(Number.POSITIVE_INFINITY), Number.POSITIVE_INFINITY,
|
||||
"Math.log2 produces incorrect output for Number.POSITIVE_INFINITY");
|
||||
assert.sameValue(Math.log2(1), 0,
|
||||
"Math.log2 produces incorrect output for 1");
|
||||
assert.sameValue(Math.log2(2.00), 1,
|
||||
"Math.log2 produces incorrect output for 2.00");
|
||||
assert.sameValue(Math.log2(4.00), 2,
|
||||
"Math.log2 produces incorrect output for 4.00");
|
||||
assert.sameValue(Math.log2(8.00), 3,
|
||||
"Math.log2 produces incorrect output for 8.00");
|
|
@ -0,0 +1,13 @@
|
|||
// Copyright 2015 Microsoft Corporation. All rights reserved.
|
||||
// This code is governed by the license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
description: Testing descriptor property of Math.log2
|
||||
includes:
|
||||
- propertyHelper.js
|
||||
es6id: 20.2.2.23
|
||||
---*/
|
||||
|
||||
verifyWritable(Math, "log2");
|
||||
verifyNotEnumerable(Math, "log2");
|
||||
verifyConfigurable(Math, "log2");
|
|
@ -0,0 +1,12 @@
|
|||
// Copyright 2015 Microsoft Corporation. All rights reserved.
|
||||
// This code is governed by the license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
description: Testing length property of Math.log2
|
||||
includes:
|
||||
- assert.js
|
||||
es6id: 20.2.2.23
|
||||
---*/
|
||||
|
||||
assert.sameValue(Math.log2.length, 1);
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
// Copyright 2015 Microsoft Corporation. All rights reserved.
|
||||
// This code is governed by the license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
description: Testing descriptor property of Math.acosh
|
||||
includes:
|
||||
- propertyHelper.js
|
||||
es6id: 20.2.2.3
|
||||
---*/
|
||||
|
||||
verifyWritable(Math, "acosh");
|
||||
verifyNotEnumerable(Math, "acosh");
|
||||
verifyConfigurable(Math, "acosh");
|
|
@ -0,0 +1,12 @@
|
|||
// Copyright 2015 Microsoft Corporation. All rights reserved.
|
||||
// This code is governed by the license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
description: Testing length property of Math.acosh
|
||||
includes:
|
||||
- assert.js
|
||||
es6id: 20.2.2.3
|
||||
---*/
|
||||
|
||||
assert.sameValue(Math.acosh.length, 1);
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
// Copyright 2015 Microsoft Corporation. All rights reserved.
|
||||
// This code is governed by the license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
description: Math.acosh with special values
|
||||
includes:
|
||||
- assert.js
|
||||
es6id: 20.2.2.3
|
||||
---*/
|
||||
|
||||
assert.sameValue(Math.acosh(NaN), Number.NaN,
|
||||
"Math.acosh produces incorrect output for NaN");
|
||||
assert.sameValue(Math.acosh(0), Number.NaN,
|
||||
"Math.acosh should produce NaN for values < 1");
|
||||
assert.sameValue(Math.acosh(Number.NEGATIVE_INFINITY), Number.NaN,
|
||||
"Math.acosh should produce NaN for inputs <1");
|
||||
assert.notSameValue(Math.acosh(Number.NEGATIVE_INFINITY),
|
||||
Number.POSITIVE_INFINITY,
|
||||
"Math.acosh should produce POSITIVE_INFINITY for input Number.POSITIVE_INFINITY");
|
||||
assert.sameValue(Math.acosh(+1), 0, "Math.acosh should produce 0 for +1");
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
// Copyright 2015 Microsoft Corporation. All rights reserved.
|
||||
// This code is governed by the license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
description: Testing descriptor property of Math.asinh
|
||||
includes:
|
||||
- propertyHelper.js
|
||||
es6id: 20.2.2.5
|
||||
---*/
|
||||
|
||||
verifyWritable(Math, "asinh");
|
||||
verifyNotEnumerable(Math, "asinh");
|
||||
verifyConfigurable(Math, "asinh");
|
|
@ -0,0 +1,12 @@
|
|||
// Copyright 2015 Microsoft Corporation. All rights reserved.
|
||||
// This code is governed by the license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
description: Testing length property of Math.asinh
|
||||
includes:
|
||||
- assert.js
|
||||
es6id: 20.2.2.5
|
||||
---*/
|
||||
|
||||
assert.sameValue(Math.asinh.length, 1);
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
// Copyright 2015 Microsoft Corporation. All rights reserved.
|
||||
// This code is governed by the license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
description: Math.asinh with special values
|
||||
includes:
|
||||
- assert.js
|
||||
es6id: 20.2.2.5
|
||||
---*/
|
||||
|
||||
assert.sameValue(Math.asinh(NaN), Number.NaN,
|
||||
"Math.asinh produces incorrect output for NaN");
|
||||
assert.sameValue(Math.asinh(Number.NEGATIVE_INFINITY), Number.NEGATIVE_INFINITY,
|
||||
"Math.asinh should produce negative infinity for Number.NEGATIVE_INFINITY");
|
||||
assert.sameValue(Math.asinh(Number.POSITIVE_INFINITY), Number.POSITIVE_INFINITY,
|
||||
"Math.asinh should produce positive infinity for Number.POSITIVE_INFINITY");
|
||||
assert.sameValue(1 / Math.asinh(-0), Number.NEGATIVE_INFINITY,
|
||||
"Math.asinh should produce -0 for -0");
|
||||
assert.sameValue(1 / Math.asinh(0), Number.POSITIVE_INFINITY,
|
||||
"Math.asinh should produce +0 for +0");
|
|
@ -0,0 +1,13 @@
|
|||
// Copyright 2015 Microsoft Corporation. All rights reserved.
|
||||
// This code is governed by the license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
description: Testing descriptor property of Math.atanh
|
||||
includes:
|
||||
- propertyHelper.js
|
||||
es6id: 20.2.2.7
|
||||
---*/
|
||||
|
||||
verifyWritable(Math, "atanh");
|
||||
verifyNotEnumerable(Math, "atanh");
|
||||
verifyConfigurable(Math, "atanh");
|
|
@ -0,0 +1,12 @@
|
|||
// Copyright 2015 Microsoft Corporation. All rights reserved.
|
||||
// This code is governed by the license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
description: Testing length property of Math.atanh
|
||||
includes:
|
||||
- assert.js
|
||||
es6id: 20.2.2.7
|
||||
---*/
|
||||
|
||||
assert.sameValue(Math.atanh.length, 1);
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
// Copyright 2015 Microsoft Corporation. All rights reserved.
|
||||
// This code is governed by the license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
description: Math.atanh with special values
|
||||
includes:
|
||||
- assert.js
|
||||
es6id: 20.2.2.7
|
||||
---*/
|
||||
|
||||
assert.sameValue(Math.atanh(-1.9), Number.NaN,
|
||||
"Math.atanh produces incorrect output for -1.9");
|
||||
assert.sameValue(Math.atanh(NaN), Number.NaN,
|
||||
"Math.atanh produces incorrect output for NaN");
|
||||
assert.sameValue(Math.atanh(-10), Number.NaN,
|
||||
"Math.atanh produces incorrect output for -10");
|
||||
assert.sameValue(Math.atanh(-Infinity), Number.NaN,
|
||||
"Math.atanh produces incorrect output for -Infinity");
|
||||
assert.sameValue(Math.atanh(1.9), Number.NaN,
|
||||
"Math.atanh produces incorrect output for 1.9");
|
||||
assert.sameValue(Math.atanh(10), Number.NaN,
|
||||
"Math.atanh produces incorrect output for 10");
|
||||
assert.sameValue(Math.atanh(Number.POSITIVE_INFINITY), Number.NaN,
|
||||
"Math.atanh produces incorrect output for Number.POSITIVE_INFINITY");
|
||||
|
||||
assert.sameValue(Math.atanh(-1), Number.NEGATIVE_INFINITY,
|
||||
"Math.atanh should produce negative infinity for -1");
|
||||
assert.sameValue(Math.atanh(+1), Number.POSITIVE_INFINITY,
|
||||
"Math.atanh should produce positive infinity for +1");
|
||||
assert.sameValue(1/Math.atanh(-0), Number.NEGATIVE_INFINITY,
|
||||
"Math.atanh should produce -0 for -0");
|
||||
assert.sameValue(1/Math.atanh(0), Number.POSITIVE_INFINITY,
|
||||
"Math.atanh should produce +0 for +0");
|
|
@ -0,0 +1,13 @@
|
|||
// Copyright 2015 Microsoft Corporation. All rights reserved.
|
||||
// This code is governed by the license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
description: Testing descriptor property of Math.cbrt
|
||||
includes:
|
||||
- propertyHelper.js
|
||||
es6id: 20.2.2.9
|
||||
---*/
|
||||
|
||||
verifyWritable(Math, "cbrt");
|
||||
verifyNotEnumerable(Math, "cbrt");
|
||||
verifyConfigurable(Math, "cbrt");
|
|
@ -0,0 +1,12 @@
|
|||
// Copyright 2015 Microsoft Corporation. All rights reserved.
|
||||
// This code is governed by the license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
description: Testing length property of Math.cbrt
|
||||
includes:
|
||||
- assert.js
|
||||
es6id: 20.2.2.9
|
||||
---*/
|
||||
|
||||
assert.sameValue(Math.cbrt.length, 1);
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
// Copyright 2015 Microsoft Corporation. All rights reserved.
|
||||
// This code is governed by the license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
description: Math.cbrt with special values
|
||||
includes:
|
||||
- assert.js
|
||||
es6id: 20.2.2.9
|
||||
---*/
|
||||
|
||||
assert.sameValue(Math.cbrt(NaN), Number.NaN,
|
||||
"Math.cbrt produces incorrect output for NaN");
|
||||
assert.sameValue(Math.cbrt(Number.NEGATIVE_INFINITY), Number.NEGATIVE_INFINITY,
|
||||
"Math.cbrt should produce negative infinity for Number.NEGATIVE_INFINITY");
|
||||
assert.sameValue(Math.cbrt(Number.POSITIVE_INFINITY), Number.POSITIVE_INFINITY,
|
||||
"Math.cbrt should produce positive infinity for Number.POSITIVE_INFINITY");
|
||||
assert.sameValue(1/Math.cbrt(-0), Number.NEGATIVE_INFINITY,
|
||||
"Math.cbrt should produce -0 for -0");
|
||||
assert.sameValue(1/Math.cbrt(0), Number.POSITIVE_INFINITY,
|
||||
"Math.cbrt should produce +0 for +0");
|
|
@ -0,0 +1,13 @@
|
|||
// Copyright 2015 Microsoft Corporation. All rights reserved.
|
||||
// This code is governed by the license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
description: Testing descriptor property of Math.cosh
|
||||
includes:
|
||||
- propertyHelper.js
|
||||
es6id: 20.2.2.13
|
||||
---*/
|
||||
|
||||
verifyWritable(Math, "cosh");
|
||||
verifyNotEnumerable(Math, "cosh");
|
||||
verifyConfigurable(Math, "cosh");
|
|
@ -0,0 +1,12 @@
|
|||
// Copyright 2015 Microsoft Corporation. All rights reserved.
|
||||
// This code is governed by the license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
description: Testing length property of Math.cosh
|
||||
includes:
|
||||
- assert.js
|
||||
es6id: 20.2.2.13
|
||||
---*/
|
||||
|
||||
assert.sameValue(Math.cosh.length, 1);
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
// Copyright 2015 Microsoft Corporation. All rights reserved.
|
||||
// This code is governed by the license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
description: Math.cosh with special values
|
||||
includes:
|
||||
- assert.js
|
||||
es6id: 20.2.2.13
|
||||
---*/
|
||||
|
||||
assert.sameValue(Math.cosh(NaN), Number.NaN,
|
||||
"Math.cosh produces incorrect output for NaN");
|
||||
assert.sameValue(Math.cosh(0), 1, "Math.cosh should produce 1 for input = 0");
|
||||
assert.sameValue(Math.cosh(-0), 1, "Math.cosh should produce 1 for input = -0");
|
||||
assert.sameValue(Math.cosh(Number.NEGATIVE_INFINITY), Number.POSITIVE_INFINITY,
|
||||
"Math.cosh should produce Number.POSITIVE_INFINITY for Number.NEGATIVE_INFINITY");
|
||||
assert.sameValue(Math.cosh(Number.POSITIVE_INFINITY), Number.POSITIVE_INFINITY,
|
||||
"Math.cosh should produce Number.POSITIVE_INFINITY for Number.POSITIVE_INFINITY");
|
|
@ -0,0 +1,13 @@
|
|||
// Copyright 2015 Microsoft Corporation. All rights reserved.
|
||||
// This code is governed by the license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
description: Testing descriptor property of Math.expm1
|
||||
includes:
|
||||
- propertyHelper.js
|
||||
es6id: 20.2.2.15
|
||||
---*/
|
||||
|
||||
verifyWritable(Math, "expm1");
|
||||
verifyNotEnumerable(Math, "expm1");
|
||||
verifyConfigurable(Math, "expm1");
|
|
@ -0,0 +1,12 @@
|
|||
// Copyright 2015 Microsoft Corporation. All rights reserved.
|
||||
// This code is governed by the license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
description: Testing length property of Math.expm1
|
||||
includes:
|
||||
- assert.js
|
||||
es6id: 20.2.2.15
|
||||
---*/
|
||||
|
||||
assert.sameValue(Math.expm1.length, 1);
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
// Copyright 2015 Microsoft Corporation. All rights reserved.
|
||||
// This code is governed by the license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
description: Math.expm1 with sample values.
|
||||
includes:
|
||||
- assert.js
|
||||
es6id: 20.2.2.15
|
||||
---*/
|
||||
|
||||
assert.sameValue(Math.expm1(NaN), Number.NaN,
|
||||
"Math.expm1 produces incorrect output for NaN");
|
||||
assert.sameValue(Math.expm1(Number.NEGATIVE_INFINITY), -1,
|
||||
"Math.expm1 should produce -1 for Number.NEGATIVE_INFINITY");
|
||||
assert.sameValue(Math.expm1(Number.POSITIVE_INFINITY), Number.POSITIVE_INFINITY,
|
||||
"Math.expm1 should produce POSITIVE infinity for Number.POSITIVE_INFINITY");
|
||||
assert.sameValue(1/Math.expm1(-0), Number.NEGATIVE_INFINITY,
|
||||
"Math.expm1 should produce -0 for -0");
|
||||
assert.sameValue(1/Math.expm1(0), Number.POSITIVE_INFINITY,
|
||||
"Math.expm1 should produce +0 for +0");
|
|
@ -0,0 +1,13 @@
|
|||
// Copyright 2015 Microsoft Corporation. All rights reserved.
|
||||
// This code is governed by the license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
description: Testing descriptor property of Math.hypot
|
||||
includes:
|
||||
- propertyHelper.js
|
||||
es6id: 20.2.2.18
|
||||
---*/
|
||||
|
||||
verifyWritable(Math, "hypot");
|
||||
verifyNotEnumerable(Math, "hypot");
|
||||
verifyConfigurable(Math, "hypot");
|
|
@ -0,0 +1,13 @@
|
|||
// Copyright 2015 Microsoft Corporation. All rights reserved.
|
||||
// This code is governed by the license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
description: Testing descriptor property of Math.imul
|
||||
includes:
|
||||
- propertyHelper.js
|
||||
es6id: 20.2.2.19
|
||||
---*/
|
||||
|
||||
verifyWritable(Math, "imul");
|
||||
verifyNotEnumerable(Math, "imul");
|
||||
verifyConfigurable(Math, "imul");
|
|
@ -0,0 +1,12 @@
|
|||
// Copyright 2015 Microsoft Corporation. All rights reserved.
|
||||
// This code is governed by the license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
description: Testing length property of Math.imul
|
||||
includes:
|
||||
- assert.js
|
||||
es6id: 20.2.2.19
|
||||
---*/
|
||||
|
||||
assert.sameValue(Math.imul.length, 2);
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
// Copyright 2015 Microsoft Corporation. All rights reserved.
|
||||
// This code is governed by the license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
description: Testing length property of Math.log10
|
||||
includes:
|
||||
- propertyHelper.js
|
||||
es6id: 20.2.2.20
|
||||
---*/
|
||||
|
||||
verifyWritable(Math, "log10");
|
||||
verifyNotEnumerable(Math, "log10");
|
||||
verifyConfigurable(Math, "log10");
|
|
@ -0,0 +1,12 @@
|
|||
// Copyright 2015 Microsoft Corporation. All rights reserved.
|
||||
// This code is governed by the license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
description: Testing length property of Math.log10
|
||||
includes:
|
||||
- assert.js
|
||||
es6id: 20.2.2.20
|
||||
---*/
|
||||
|
||||
assert.sameValue(Math.log10.length, 1);
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
// Copyright 2015 Microsoft Corporation. All rights reserved.
|
||||
// This code is governed by the license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
description: Math.Log10 with sample values.
|
||||
includes:
|
||||
- assert.js
|
||||
es6id: 20.2.2.20
|
||||
---*/
|
||||
|
||||
assert.sameValue(Math.log10(-0), Number.NEGATIVE_INFINITY,
|
||||
"Math.log10 produces incorrect output for -0");
|
||||
assert.sameValue(Math.log10(+0), Number.NEGATIVE_INFINITY,
|
||||
"Math.log10 produces incorrect output for +0");
|
||||
assert.sameValue(Math.log10(-0.9), Number.NaN,
|
||||
"Math.log10 produces incorrect output for -0.9");
|
||||
assert.sameValue(Math.log10(NaN), Number.NaN,
|
||||
"Math.log10 produces incorrect output for NaN");
|
||||
assert.sameValue(Math.log10(-10), Number.NaN,
|
||||
"Math.log10 produces incorrect output for -10");
|
||||
assert.sameValue(Math.log10(null), Number.NEGATIVE_INFINITY,
|
||||
"Math.log10 produces incorrect output for null");
|
||||
assert.sameValue(Math.log10(undefined), Number.NaN,
|
||||
"Math.log10 produces incorrect output for undefined");
|
||||
assert.sameValue(Math.log10(Number.POSITIVE_INFINITY), Number.POSITIVE_INFINITY,
|
||||
"Math.log10 produces incorrect output for Number.POSITIVE_INFINITY");
|
||||
assert.sameValue(Math.log10(1), 0,
|
||||
"Math.log10 produces incorrect output for 1");
|
||||
assert.sameValue(Math.log10(10.00), 1,
|
||||
"Math.log10 produces incorrect output for 10.00");
|
||||
assert.sameValue(Math.log10(100.00), 2,
|
||||
"Math.log10 produces incorrect output for 100.00");
|
||||
assert.sameValue(Math.log10(1000.00), 3,
|
||||
"Math.log10 produces incorrect output for 1000.00");
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
// Copyright 2015 Microsoft Corporation. All rights reserved.
|
||||
// This code is governed by the license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
description: Testing descriptor property of Math.log1p
|
||||
includes:
|
||||
- propertyHelper.js
|
||||
es6id: 20.2.2.21
|
||||
---*/
|
||||
|
||||
verifyWritable(Math, "log1p");
|
||||
verifyNotEnumerable(Math, "log1p");
|
||||
verifyConfigurable(Math, "log1p");
|
|
@ -0,0 +1,12 @@
|
|||
// Copyright 2015 Microsoft Corporation. All rights reserved.
|
||||
// This code is governed by the license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
description: Testing length property of Math.log1p
|
||||
includes:
|
||||
- assert.js
|
||||
es6id: 20.2.2.21
|
||||
---*/
|
||||
|
||||
assert.sameValue(Math.log1p.length, 1);
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
// Copyright 2015 Microsoft Corporation. All rights reserved.
|
||||
// This code is governed by the license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
description: Testing descriptor property of Math.sign
|
||||
includes:
|
||||
- propertyHelper.js
|
||||
es6id: 20.2.2.29
|
||||
---*/
|
||||
|
||||
verifyWritable(Math, "sign");
|
||||
verifyNotEnumerable(Math, "sign");
|
||||
verifyConfigurable(Math, "sign");
|
|
@ -0,0 +1,12 @@
|
|||
// Copyright 2015 Microsoft Corporation. All rights reserved.
|
||||
// This code is governed by the license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
description: Testing length property of Math.sign
|
||||
includes:
|
||||
- assert.js
|
||||
es6id: 20.2.2.29
|
||||
---*/
|
||||
|
||||
assert.sameValue(Math.sign.length, 1);
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
// Copyright 2015 Microsoft Corporation. All rights reserved.
|
||||
// This code is governed by the license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
description: Math.sign with special values
|
||||
includes:
|
||||
- assert.js
|
||||
es6id: 20.2.2.29
|
||||
---*/
|
||||
|
||||
assert.sameValue(Math.sign(NaN), Number.NaN,
|
||||
"Math.sign produces incorrect output for NaN");
|
||||
assert.sameValue(1/Math.sign(-0), Number.NEGATIVE_INFINITY,
|
||||
"Math.sign produces incorrect output for -0");
|
||||
assert.sameValue(1/Math.sign(0), Number.POSITIVE_INFINITY,
|
||||
"Math.sign produces incorrect output for 0");
|
|
@ -0,0 +1,13 @@
|
|||
// Copyright 2015 Microsoft Corporation. All rights reserved.
|
||||
// This code is governed by the license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
description: Testing descriptor property of Math.sinh
|
||||
includes:
|
||||
- propertyHelper.js
|
||||
es6id: 20.2.2.31
|
||||
---*/
|
||||
|
||||
verifyWritable(Math, "sinh");
|
||||
verifyNotEnumerable(Math, "sinh");
|
||||
verifyConfigurable(Math, "sinh");
|
|
@ -0,0 +1,12 @@
|
|||
// Copyright 2015 Microsoft Corporation. All rights reserved.
|
||||
// This code is governed by the license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
description: Testing length property of Math.sinh
|
||||
includes:
|
||||
- assert.js
|
||||
es6id: 20.2.2.31
|
||||
---*/
|
||||
|
||||
assert.sameValue(Math.sinh.length, 1);
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
// Copyright 2015 Microsoft Corporation. All rights reserved.
|
||||
// This code is governed by the license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
description: Math.sinh with special values
|
||||
includes:
|
||||
- assert.js
|
||||
es6id: 20.2.2.31
|
||||
---*/
|
||||
|
||||
assert.sameValue(Math.sinh(NaN), Number.NaN,
|
||||
"Math.sinh produces incorrect output for NaN");
|
||||
assert.sameValue(Math.sinh(Number.NEGATIVE_INFINITY), Number.NEGATIVE_INFINITY,
|
||||
"Math.sinh should produce negative infinity for Number.NEGATIVE_INFINITY");
|
||||
assert.sameValue(Math.sinh(Number.POSITIVE_INFINITY), Number.POSITIVE_INFINITY,
|
||||
"Math.sinh should produce positive infinity for Number.POSITIVE_INFINITY");
|
||||
assert.sameValue(1/Math.sinh(-0), Number.NEGATIVE_INFINITY,
|
||||
"Math.sinh should produce -0 for -0");
|
||||
assert.sameValue(1/Math.sinh(0), Number.POSITIVE_INFINITY,
|
||||
"Math.sinh should produce +0 for +0");
|
|
@ -0,0 +1,13 @@
|
|||
// Copyright 2015 Microsoft Corporation. All rights reserved.
|
||||
// This code is governed by the license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
description: Testing descriptor property of Math.tanh
|
||||
includes:
|
||||
- propertyHelper.js
|
||||
es6id: 20.2.2.34
|
||||
---*/
|
||||
|
||||
verifyWritable(Math, "tanh");
|
||||
verifyNotEnumerable(Math, "tanh");
|
||||
verifyConfigurable(Math, "tanh");
|
|
@ -0,0 +1,12 @@
|
|||
// Copyright 2015 Microsoft Corporation. All rights reserved.
|
||||
// This code is governed by the license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
description: Testing length property of Math.tanh
|
||||
includes:
|
||||
- assert.js
|
||||
es6id: 20.2.2.34
|
||||
---*/
|
||||
|
||||
assert.sameValue(Math.tanh.length, 1);
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
// Copyright 2015 Microsoft Corporation. All rights reserved.
|
||||
// This code is governed by the license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
description: Math.tanh with special values
|
||||
includes:
|
||||
- assert.js
|
||||
es6id: 20.2.2.34
|
||||
---*/
|
||||
|
||||
assert.sameValue(Math.tanh(NaN), Number.NaN,
|
||||
"Math.tanh produces incorrect output for NaN");
|
||||
assert.sameValue(Math.tanh(Number.NEGATIVE_INFINITY), -1,
|
||||
"Math.tanh should produce -1 for Number.NEGATIVE_INFINITY");
|
||||
assert.sameValue(Math.tanh(Number.POSITIVE_INFINITY), 1,
|
||||
"Math.tanh should produce 1 for Number.POSITIVE_INFINITY");
|
||||
assert.sameValue(1/Math.tanh(-0), Number.NEGATIVE_INFINITY,
|
||||
"Math.tanh should produce -0 for -0");
|
||||
assert.sameValue(1/Math.tanh(0), Number.POSITIVE_INFINITY,
|
||||
"Math.tanh should produce +0 for +0");
|
|
@ -0,0 +1,13 @@
|
|||
// Copyright 2015 Microsoft Corporation. All rights reserved.
|
||||
// This code is governed by the license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
description: Testing descriptor property of Math.trunc
|
||||
includes:
|
||||
- propertyHelper.js
|
||||
es6id: 20.2.2.35
|
||||
---*/
|
||||
|
||||
verifyWritable(Math, "trunc");
|
||||
verifyNotEnumerable(Math, "trunc");
|
||||
verifyConfigurable(Math, "trunc");
|
|
@ -0,0 +1,12 @@
|
|||
// Copyright 2015 Microsoft Corporation. All rights reserved.
|
||||
// This code is governed by the license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
description: Testing length property of Math.trunc
|
||||
includes:
|
||||
- assert.js
|
||||
es6id: 20.2.2.35
|
||||
---*/
|
||||
|
||||
assert.sameValue(Math.trunc.length, 1);
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
// Copyright 2015 Microsoft Corporation. All rights reserved.
|
||||
// This code is governed by the license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
description: sample tests for trunc
|
||||
includes: [assert.js]
|
||||
es6id: 20.2.2.35
|
||||
---*/
|
||||
|
||||
assert.sameValue(1 / Math.trunc(0.02047410048544407), Number.POSITIVE_INFINITY,
|
||||
"Math.trunc should produce +0 for values between 0 and 1");
|
||||
assert.sameValue(1 / Math.trunc(0.00000000000000001), Number.POSITIVE_INFINITY,
|
||||
"Math.trunc should produce +0 for values between 0 and 1");
|
||||
assert.sameValue(1 / Math.trunc(0.9999999999999999), Number.POSITIVE_INFINITY,
|
||||
"Math.trunc should produce +0 for values between 0 and 1");
|
||||
assert.sameValue(1 / Math.trunc(Number.EPSILON), Number.POSITIVE_INFINITY,
|
||||
"Math.trunc should produce +0 for values between 0 and 1");
|
||||
assert.sameValue(1 / Math.trunc(Number.MIN_VALUE), Number.POSITIVE_INFINITY,
|
||||
"Math.trunc should produce +0 for values between 0 and 1");
|
||||
|
||||
assert.sameValue(1 / Math.trunc(-0.02047410048544407), Number.NEGATIVE_INFINITY,
|
||||
"Math.trunc should produce -0 for values between -1 and 0");
|
||||
assert.sameValue(1 / Math.trunc(-0.00000000000000001), Number.NEGATIVE_INFINITY,
|
||||
"Math.trunc should produce -0 for values between -1 and 0");
|
||||
assert.sameValue(1 / Math.trunc(-0.9999999999999999), Number.NEGATIVE_INFINITY,
|
||||
"Math.trunc should produce -0 for values between -1 and 0");
|
||||
assert.sameValue(1 / Math.trunc(-Number.EPSILON), Number.NEGATIVE_INFINITY,
|
||||
"Math.trunc should produce -0 for values between -1 and 0");
|
||||
assert.sameValue(1 / Math.trunc(-Number.MIN_VALUE), Number.NEGATIVE_INFINITY,
|
||||
"Math.trunc should produce -0 for values between -1 and 0");
|
||||
|
||||
assert.sameValue(Math.trunc(Number.MAX_VALUE), Math.floor(Number.MAX_VALUE),
|
||||
"Math.trunc produces incorrect result for Number.MAX_VALUE");
|
||||
assert.sameValue(Math.trunc(10), Math.floor(10),
|
||||
"Math.trunc produces incorrect result for 10");
|
||||
assert.sameValue(Math.trunc(3.9), Math.floor(3.9),
|
||||
"Math.trunc produces incorrect result for 3.9");
|
||||
assert.sameValue(Math.trunc(4.9), Math.floor(4.9),
|
||||
"Math.trunc produces incorrect result for 4.9");
|
||||
|
||||
assert.sameValue(Math.trunc(-Number.MAX_VALUE), Math.ceil(-Number.MAX_VALUE),
|
||||
"Math.trunc produces incorrect result for -Number.MAX_VALUE");
|
||||
assert.sameValue(Math.trunc(-10), Math.ceil(-10),
|
||||
"Math.trunc produces incorrect result for -10");
|
||||
assert.sameValue(Math.trunc(-3.9), Math.ceil(-3.9),
|
||||
"Math.trunc produces incorrect result for -3.9");
|
||||
assert.sameValue(Math.trunc(-4.9), Math.ceil(-4.9),
|
||||
"Math.trunc produces incorrect result for -4.9");
|
|
@ -0,0 +1,18 @@
|
|||
// Copyright 2015 Microsoft Corporation. All rights reserved.
|
||||
// This code is governed by the license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
description: Math.trunc with sample values.
|
||||
includes:
|
||||
- assert.js
|
||||
es6id: 20.2.2.35
|
||||
---*/
|
||||
|
||||
assert.sameValue(Math.trunc(Number.NEGATIVE_INFINITY), Number.NEGATIVE_INFINITY,
|
||||
"Math.trunc should produce negative infinity for Number.NEGATIVE_INFINITY");
|
||||
assert.sameValue(Math.trunc(Number.POSITIVE_INFINITY), Number.POSITIVE_INFINITY,
|
||||
"Math.trunc should produce positive infinity for Number.POSITIVE_INFINITY");
|
||||
assert.sameValue(1/Math.trunc(-0), Number.NEGATIVE_INFINITY,
|
||||
"Math.trunc should produce -0 for -0");
|
||||
assert.sameValue(1/Math.trunc(0), Number.POSITIVE_INFINITY,
|
||||
"Math.trunc should produce +0 for +0");
|
Loading…
Reference in New Issue