diff --git a/test/built-ins/Math/Log2/Log2-basicTests.js b/test/built-ins/Math/Log2/Log2-basicTests.js new file mode 100644 index 0000000000..af00361ce5 --- /dev/null +++ b/test/built-ins/Math/Log2/Log2-basicTests.js @@ -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"); diff --git a/test/built-ins/Math/Log2/Log2-descriptor.js b/test/built-ins/Math/Log2/Log2-descriptor.js new file mode 100644 index 0000000000..2e88d306b9 --- /dev/null +++ b/test/built-ins/Math/Log2/Log2-descriptor.js @@ -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"); diff --git a/test/built-ins/Math/Log2/Log2-length.js b/test/built-ins/Math/Log2/Log2-length.js new file mode 100644 index 0000000000..10e299c020 --- /dev/null +++ b/test/built-ins/Math/Log2/Log2-length.js @@ -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); + diff --git a/test/built-ins/Math/acosh/acosh-descriptor.js b/test/built-ins/Math/acosh/acosh-descriptor.js new file mode 100644 index 0000000000..7902919f38 --- /dev/null +++ b/test/built-ins/Math/acosh/acosh-descriptor.js @@ -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"); diff --git a/test/built-ins/Math/acosh/acosh-length.js b/test/built-ins/Math/acosh/acosh-length.js new file mode 100644 index 0000000000..a3c618120c --- /dev/null +++ b/test/built-ins/Math/acosh/acosh-length.js @@ -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); + diff --git a/test/built-ins/Math/acosh/acosh-specialVals.js b/test/built-ins/Math/acosh/acosh-specialVals.js new file mode 100644 index 0000000000..3bf8eb3d79 --- /dev/null +++ b/test/built-ins/Math/acosh/acosh-specialVals.js @@ -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"); + diff --git a/test/built-ins/Math/asinh/asinh-descriptor.js b/test/built-ins/Math/asinh/asinh-descriptor.js new file mode 100644 index 0000000000..16d5675205 --- /dev/null +++ b/test/built-ins/Math/asinh/asinh-descriptor.js @@ -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"); diff --git a/test/built-ins/Math/asinh/asinh-length.js b/test/built-ins/Math/asinh/asinh-length.js new file mode 100644 index 0000000000..de235db03f --- /dev/null +++ b/test/built-ins/Math/asinh/asinh-length.js @@ -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); + diff --git a/test/built-ins/Math/asinh/asinh-specialVals.js b/test/built-ins/Math/asinh/asinh-specialVals.js new file mode 100644 index 0000000000..95a303b854 --- /dev/null +++ b/test/built-ins/Math/asinh/asinh-specialVals.js @@ -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"); diff --git a/test/built-ins/Math/atanh/atanh-descriptor.js b/test/built-ins/Math/atanh/atanh-descriptor.js new file mode 100644 index 0000000000..fef5d9b32a --- /dev/null +++ b/test/built-ins/Math/atanh/atanh-descriptor.js @@ -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"); diff --git a/test/built-ins/Math/atanh/atanh-length.js b/test/built-ins/Math/atanh/atanh-length.js new file mode 100644 index 0000000000..0d58061ffd --- /dev/null +++ b/test/built-ins/Math/atanh/atanh-length.js @@ -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); + diff --git a/test/built-ins/Math/atanh/atanh-specialVals.js b/test/built-ins/Math/atanh/atanh-specialVals.js new file mode 100644 index 0000000000..e3fb840847 --- /dev/null +++ b/test/built-ins/Math/atanh/atanh-specialVals.js @@ -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"); diff --git a/test/built-ins/Math/cbrt/cbrt-descriptor.js b/test/built-ins/Math/cbrt/cbrt-descriptor.js new file mode 100644 index 0000000000..3e5e326c3d --- /dev/null +++ b/test/built-ins/Math/cbrt/cbrt-descriptor.js @@ -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"); diff --git a/test/built-ins/Math/cbrt/cbrt-length.js b/test/built-ins/Math/cbrt/cbrt-length.js new file mode 100644 index 0000000000..36fa55b6dc --- /dev/null +++ b/test/built-ins/Math/cbrt/cbrt-length.js @@ -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); + diff --git a/test/built-ins/Math/cbrt/cbrt-specialValues.js b/test/built-ins/Math/cbrt/cbrt-specialValues.js new file mode 100644 index 0000000000..973264caaa --- /dev/null +++ b/test/built-ins/Math/cbrt/cbrt-specialValues.js @@ -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"); diff --git a/test/built-ins/Math/cosh/cosh-descriptor.js b/test/built-ins/Math/cosh/cosh-descriptor.js new file mode 100644 index 0000000000..f0ab954beb --- /dev/null +++ b/test/built-ins/Math/cosh/cosh-descriptor.js @@ -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"); diff --git a/test/built-ins/Math/cosh/cosh-length.js b/test/built-ins/Math/cosh/cosh-length.js new file mode 100644 index 0000000000..cb61f975a4 --- /dev/null +++ b/test/built-ins/Math/cosh/cosh-length.js @@ -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); + diff --git a/test/built-ins/Math/cosh/cosh-specialVals.js b/test/built-ins/Math/cosh/cosh-specialVals.js new file mode 100644 index 0000000000..1cf5b35de0 --- /dev/null +++ b/test/built-ins/Math/cosh/cosh-specialVals.js @@ -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"); diff --git a/test/built-ins/Math/expm1/expm1-descriptor.js b/test/built-ins/Math/expm1/expm1-descriptor.js new file mode 100644 index 0000000000..1c167feab6 --- /dev/null +++ b/test/built-ins/Math/expm1/expm1-descriptor.js @@ -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"); diff --git a/test/built-ins/Math/expm1/expm1-length.js b/test/built-ins/Math/expm1/expm1-length.js new file mode 100644 index 0000000000..2bca0f24f2 --- /dev/null +++ b/test/built-ins/Math/expm1/expm1-length.js @@ -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); + diff --git a/test/built-ins/Math/expm1/expm1-specialVals.js b/test/built-ins/Math/expm1/expm1-specialVals.js new file mode 100644 index 0000000000..f459faed24 --- /dev/null +++ b/test/built-ins/Math/expm1/expm1-specialVals.js @@ -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"); diff --git a/test/built-ins/Math/hypot/hypot-descriptor.js b/test/built-ins/Math/hypot/hypot-descriptor.js new file mode 100644 index 0000000000..d755d05af0 --- /dev/null +++ b/test/built-ins/Math/hypot/hypot-descriptor.js @@ -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"); diff --git a/test/built-ins/Math/imul/imul-descriptor.js b/test/built-ins/Math/imul/imul-descriptor.js new file mode 100644 index 0000000000..58e2521fd5 --- /dev/null +++ b/test/built-ins/Math/imul/imul-descriptor.js @@ -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"); diff --git a/test/built-ins/Math/imul/imul-length.js b/test/built-ins/Math/imul/imul-length.js new file mode 100644 index 0000000000..ce0f4a818b --- /dev/null +++ b/test/built-ins/Math/imul/imul-length.js @@ -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); + diff --git a/test/built-ins/Math/log10/Log10-descriptor.js b/test/built-ins/Math/log10/Log10-descriptor.js new file mode 100644 index 0000000000..95545495a9 --- /dev/null +++ b/test/built-ins/Math/log10/Log10-descriptor.js @@ -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"); diff --git a/test/built-ins/Math/log10/Log10-length.js b/test/built-ins/Math/log10/Log10-length.js new file mode 100644 index 0000000000..63bcbf5aea --- /dev/null +++ b/test/built-ins/Math/log10/Log10-length.js @@ -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); + diff --git a/test/built-ins/Math/log10/Log10-specialVals.js b/test/built-ins/Math/log10/Log10-specialVals.js new file mode 100644 index 0000000000..c6a9a74ec0 --- /dev/null +++ b/test/built-ins/Math/log10/Log10-specialVals.js @@ -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"); + diff --git a/test/built-ins/Math/log1p/Log1p-descriptor.js b/test/built-ins/Math/log1p/Log1p-descriptor.js new file mode 100644 index 0000000000..634456806a --- /dev/null +++ b/test/built-ins/Math/log1p/Log1p-descriptor.js @@ -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"); diff --git a/test/built-ins/Math/log1p/Log1p-length.js b/test/built-ins/Math/log1p/Log1p-length.js new file mode 100644 index 0000000000..4b326cb1fe --- /dev/null +++ b/test/built-ins/Math/log1p/Log1p-length.js @@ -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); + diff --git a/test/built-ins/Math/sign/sign-descriptor.js b/test/built-ins/Math/sign/sign-descriptor.js new file mode 100644 index 0000000000..d668ab9838 --- /dev/null +++ b/test/built-ins/Math/sign/sign-descriptor.js @@ -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"); diff --git a/test/built-ins/Math/sign/sign-length.js b/test/built-ins/Math/sign/sign-length.js new file mode 100644 index 0000000000..cd439055fc --- /dev/null +++ b/test/built-ins/Math/sign/sign-length.js @@ -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); + diff --git a/test/built-ins/Math/sign/sign-specialVals.js b/test/built-ins/Math/sign/sign-specialVals.js new file mode 100644 index 0000000000..32a921c43a --- /dev/null +++ b/test/built-ins/Math/sign/sign-specialVals.js @@ -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"); diff --git a/test/built-ins/Math/sinh/sinh-descriptor.js b/test/built-ins/Math/sinh/sinh-descriptor.js new file mode 100644 index 0000000000..ef3aa77257 --- /dev/null +++ b/test/built-ins/Math/sinh/sinh-descriptor.js @@ -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"); diff --git a/test/built-ins/Math/sinh/sinh-length.js b/test/built-ins/Math/sinh/sinh-length.js new file mode 100644 index 0000000000..bbf2a769cf --- /dev/null +++ b/test/built-ins/Math/sinh/sinh-length.js @@ -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); + diff --git a/test/built-ins/Math/sinh/sinh-specialVals.js b/test/built-ins/Math/sinh/sinh-specialVals.js new file mode 100644 index 0000000000..113ec90e6d --- /dev/null +++ b/test/built-ins/Math/sinh/sinh-specialVals.js @@ -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"); diff --git a/test/built-ins/Math/tanh/tanh-descriptor.js b/test/built-ins/Math/tanh/tanh-descriptor.js new file mode 100644 index 0000000000..cd3f6d0e7f --- /dev/null +++ b/test/built-ins/Math/tanh/tanh-descriptor.js @@ -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"); diff --git a/test/built-ins/Math/tanh/tanh-length.js b/test/built-ins/Math/tanh/tanh-length.js new file mode 100644 index 0000000000..2f99aaadc2 --- /dev/null +++ b/test/built-ins/Math/tanh/tanh-length.js @@ -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); + diff --git a/test/built-ins/Math/tanh/tanh-specialVals.js b/test/built-ins/Math/tanh/tanh-specialVals.js new file mode 100644 index 0000000000..bd1cad81f9 --- /dev/null +++ b/test/built-ins/Math/tanh/tanh-specialVals.js @@ -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"); diff --git a/test/built-ins/Math/trunc/trunc-descriptor.js b/test/built-ins/Math/trunc/trunc-descriptor.js new file mode 100644 index 0000000000..240aa532dd --- /dev/null +++ b/test/built-ins/Math/trunc/trunc-descriptor.js @@ -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"); diff --git a/test/built-ins/Math/trunc/trunc-length.js b/test/built-ins/Math/trunc/trunc-length.js new file mode 100644 index 0000000000..fa71f51333 --- /dev/null +++ b/test/built-ins/Math/trunc/trunc-length.js @@ -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); + diff --git a/test/built-ins/Math/trunc/trunc-sampleTests.js b/test/built-ins/Math/trunc/trunc-sampleTests.js new file mode 100644 index 0000000000..d4f70fc415 --- /dev/null +++ b/test/built-ins/Math/trunc/trunc-sampleTests.js @@ -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"); diff --git a/test/built-ins/Math/trunc/trunc-specialVals.js b/test/built-ins/Math/trunc/trunc-specialVals.js new file mode 100644 index 0000000000..35c5148f9b --- /dev/null +++ b/test/built-ins/Math/trunc/trunc-specialVals.js @@ -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");