diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d2978326..8f91ec4b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -166,6 +166,7 @@ A total of 3 people contributed to this release. Thank you to the following cont
+- [`0ab9fc7`](https://github.com/stdlib-js/stdlib/commit/0ab9fc7de86012c670189711b6c6627b41119537) - **test:** add and modify tests [(#2830)](https://github.com/stdlib-js/stdlib/pull/2830) _(by Gunj Joshi)_ - [`16c19b6`](https://github.com/stdlib-js/stdlib/commit/16c19b67c7452b3ae9755cc7ef2a5d2540ab1cf9) - **feat:** add `math/base/special/xlogyf` [(#2813)](https://github.com/stdlib-js/stdlib/pull/2813) _(by Gunj Joshi)_ - [`71c43cf`](https://github.com/stdlib-js/stdlib/commit/71c43cf5165749e2ce2647cb52d92f6c97f16959) - **feat:** add `math/base/special/ldexpf` _(by Gunj Joshi, Philipp Burckhardt)_ - [`6c8f019`](https://github.com/stdlib-js/stdlib/commit/6c8f019db8adb12466250957693edb9830496a7b) - **feat:** add `math/base/special/logf` _(by Gunj Joshi, Philipp Burckhardt)_ diff --git a/base/special/maxabs/test/test.js b/base/special/maxabs/test/test.js index eec54723b..9d4ff7155 100644 --- a/base/special/maxabs/test/test.js +++ b/base/special/maxabs/test/test.js @@ -39,13 +39,13 @@ tape( 'the function returns `NaN` if provided a `NaN`', function test( t ) { var v; v = maxabs( NaN, 3.14 ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); v = maxabs( 3.14, NaN ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); - v = maxabs( NaN ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + v = maxabs( NaN, NaN ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); t.end(); }); @@ -54,10 +54,10 @@ tape( 'the function returns `+Infinity` if provided `+Infinity`', function test( var v; v = maxabs( PINF, 3.14 ); - t.strictEqual( v, PINF, 'returns +infinity' ); + t.strictEqual( v, PINF, 'returns expected value' ); v = maxabs( 3.14, PINF ); - t.strictEqual( v, PINF, 'returns +infinity' ); + t.strictEqual( v, PINF, 'returns expected value' ); t.end(); }); @@ -66,16 +66,16 @@ tape( 'the function returns a correctly signed zero', function test( t ) { var v; v = maxabs( +0.0, -0.0 ); - t.strictEqual( isPositiveZero( v ), true, 'returns +0' ); + t.strictEqual( isPositiveZero( v ), true, 'returns expected value' ); v = maxabs( -0.0, +0.0 ); - t.strictEqual( isPositiveZero( v ), true, 'returns +0' ); + t.strictEqual( isPositiveZero( v ), true, 'returns expected value' ); v = maxabs( -0.0, -0.0 ); - t.strictEqual( isPositiveZero( v ), true, 'returns +0' ); + t.strictEqual( isPositiveZero( v ), true, 'returns expected value' ); v = maxabs( +0.0, +0.0 ); - t.strictEqual( isPositiveZero( v ), true, 'returns +0' ); + t.strictEqual( isPositiveZero( v ), true, 'returns expected value' ); t.end(); }); diff --git a/base/special/maxabs/test/test.native.js b/base/special/maxabs/test/test.native.js index 15995439a..f1ecb35bd 100644 --- a/base/special/maxabs/test/test.native.js +++ b/base/special/maxabs/test/test.native.js @@ -48,10 +48,25 @@ tape( 'the function returns `NaN` if provided a `NaN`', opts, function test( t ) var v; v = maxabs( NaN, 3.14 ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); v = maxabs( 3.14, NaN ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); + + v = maxabs( NaN, NaN ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns `+Infinity` if provided `+Infinity`', opts, function test( t ) { + var v; + + v = maxabs( PINF, 3.14 ); + t.strictEqual( v, PINF, 'returns expected value' ); + + v = maxabs( 3.14, PINF ); + t.strictEqual( v, PINF, 'returns expected value' ); t.end(); }); @@ -60,16 +75,16 @@ tape( 'the function returns a correctly signed zero', opts, function test( t ) { var v; v = maxabs( +0.0, -0.0 ); - t.strictEqual( isPositiveZero( v ), true, 'returns +0' ); + t.strictEqual( isPositiveZero( v ), true, 'returns expected value' ); v = maxabs( -0.0, +0.0 ); - t.strictEqual( isPositiveZero( v ), true, 'returns +0' ); + t.strictEqual( isPositiveZero( v ), true, 'returns expected value' ); v = maxabs( -0.0, -0.0 ); - t.strictEqual( isPositiveZero( v ), true, 'returns +0' ); + t.strictEqual( isPositiveZero( v ), true, 'returns expected value' ); v = maxabs( +0.0, +0.0 ); - t.strictEqual( isPositiveZero( v ), true, 'returns +0' ); + t.strictEqual( isPositiveZero( v ), true, 'returns expected value' ); t.end(); }); @@ -83,11 +98,5 @@ tape( 'the function returns the maximum absolute value', opts, function test( t v = maxabs( -4.2, 3.14 ); t.strictEqual( v, 4.2, 'returns expected value' ); - v = maxabs( PINF, 3.14 ); - t.strictEqual( v, PINF, 'returns expected value' ); - - v = maxabs( 3.14, PINF ); - t.strictEqual( v, PINF, 'returns expected value' ); - t.end(); });