From ca18acd38cae8b4683a6eb6783ebc671c4636097 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 13 Sep 2026 10:18:16 +0000 Subject: [PATCH 1/5] test: migrate `lapack/base/crot` to ULP-based assertions - Replace EPS/absf-based relative tolerance with isAlmostSameValuef ULP assertions - Inline measured ULP values at each call site (viewX=0, viewY varies 0-5) - Remove unused EPS, absf imports and delta/tol/ULP variables Ref: https://github.com/stdlib-js/stdlib/issues/11352 Co-Authored-By: Claude Opus 5 (1M context) --- .../lapack/base/crot/test/test.crot.js | 51 ++++++++----------- .../lapack/base/crot/test/test.ndarray.js | 47 +++++++---------- 2 files changed, 38 insertions(+), 60 deletions(-) diff --git a/lib/node_modules/@stdlib/lapack/base/crot/test/test.crot.js b/lib/node_modules/@stdlib/lapack/base/crot/test/test.crot.js index 3fb14fdf4626..0e71b7755b70 100644 --- a/lib/node_modules/@stdlib/lapack/base/crot/test/test.crot.js +++ b/lib/node_modules/@stdlib/lapack/base/crot/test/test.crot.js @@ -24,11 +24,9 @@ var tape = require( 'tape' ); var Float32Array = require( '@stdlib/array/float32' ); var Complex64Array = require( '@stdlib/array/complex64' ); var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var EPS = require( '@stdlib/constants/float32/eps' ); -var absf = require( '@stdlib/math/base/special/absf' ); +var isAlmostSameValuef = require( '@stdlib/number/float32/base/assert/is-almost-same-value' ); var crot = require( './../lib/crot.js' ); - // FUNCTIONS // /** @@ -38,26 +36,17 @@ var crot = require( './../lib/crot.js' ); * @param {Object} t - test object * @param {Collection} actual - actual values * @param {Collection} expected - expected values -* @param {number} rtol - relative tolerance +* @param {NonNegativeInteger} ulp - maximum allowed ULP difference */ -function isApprox( t, actual, expected, rtol ) { - var delta; - var tol; +function isApprox( t, actual, expected, ulp ) { var i; t.strictEqual( actual.length, expected.length, 'returns expected value' ); for ( i = 0; i < expected.length; i++ ) { - if ( actual[ i ] === expected[ i ] ) { - t.strictEqual( actual[ i ], expected[ i ], 'returns expected value' ); - } else { - delta = absf( actual[ i ] - expected[ i ] ); - tol = rtol * EPS * absf( expected[ i ] ); - t.ok( delta <= tol, 'within tolerance. actual: '+actual[ i ]+'. expected: '+expected[ i ]+'. delta: '+delta+'. tol: '+tol+'.' ); - } + t.strictEqual( isAlmostSameValuef( actual[ i ], expected[ i ], ulp ), true, 'returns expected value' ); } } - // TESTS // tape( 'main export is a function', function test( t ) { @@ -130,8 +119,8 @@ tape( 'the function applies a plane rotation', function test( t ) { ]); out = crot( cx.length, cx, 1, cy, 1, 0.8, s ); - isApprox( t, viewX, cxe, 2.0 ); - isApprox( t, viewY, cye, 2.0 ); + isApprox( t, viewX, cxe, 0 ); + isApprox( t, viewY, cye, 1 ); t.strictEqual( out, cy, 'returns expected value' ); t.end(); }); @@ -195,8 +184,8 @@ tape( 'the function applies a plane rotation', function test( t ) { ]); out = crot( cx.length, cx, 1, cy, 1, 1.25, s ); - isApprox( t, viewX, cxe, 2.0 ); - isApprox( t, viewY, cye, 2.0 ); + isApprox( t, viewX, cxe, 0 ); + isApprox( t, viewY, cye, 0 ); t.strictEqual( out, cy, 'returns expected value' ); t.end(); }); @@ -260,8 +249,8 @@ tape( 'the function applies a plane rotation', function test( t ) { ]); out = crot( cx.length, cx, 1, cy, 1, 1.25, s ); - isApprox( t, viewX, cxe, 2.0 ); - isApprox( t, viewY, cye, 4.0 ); + isApprox( t, viewX, cxe, 0 ); + isApprox( t, viewY, cye, 5 ); t.strictEqual( out, cy, 'returns expected value' ); t.end(); }); @@ -323,8 +312,8 @@ tape( 'the function supports an `x` stride', function test( t ) { ]); out = crot( 2, cx, 2, cy, 1, 0.8, s ); - isApprox( t, viewX, cxe, 2.0 ); - isApprox( t, viewY, cye, 4.0 ); + isApprox( t, viewX, cxe, 0 ); + isApprox( t, viewY, cye, 5 ); t.strictEqual( out, cy, 'returns expected value' ); t.end(); }); @@ -386,8 +375,8 @@ tape( 'the function supports a `y` stride', function test( t ) { ]); out = crot( 2, cx, 1, cy, 2, 0.8, s ); - isApprox( t, viewX, cxe, 2.0 ); - isApprox( t, viewY, cye, 2.0 ); + isApprox( t, viewX, cxe, 0 ); + isApprox( t, viewY, cye, 1 ); t.strictEqual( out, cy, 'returns expected value' ); t.end(); }); @@ -495,8 +484,8 @@ tape( 'the function supports negative strides', function test( t ) { ]); out = crot( 2, cx, -1, cy, -2, 0.8, s ); - isApprox( t, viewX, cxe, 2.0 ); - isApprox( t, viewY, cye, 2.0 ); + isApprox( t, viewX, cxe, 0 ); + isApprox( t, viewY, cye, 1 ); t.strictEqual( out, cy, 'returns expected value' ); t.end(); }); @@ -558,8 +547,8 @@ tape( 'the function supports complex access patterns', function test( t ) { ]); out = crot( 2, cx, 2, cy, -1, 0.8, s ); - isApprox( t, viewX, cxe, 2.0 ); - isApprox( t, viewY, cye, 4.0 ); + isApprox( t, viewX, cxe, 0 ); + isApprox( t, viewY, cye, 5 ); t.strictEqual( out, cy, 'returns expected value' ); t.end(); }); @@ -629,8 +618,8 @@ tape( 'the function supports view offsets', function test( t ) { ]); out = crot( 2, cx1, -2, cy1, 1, 0.8, s ); - isApprox( t, viewX, cxe, 2.0 ); - isApprox( t, viewY, cye, 4.0 ); + isApprox( t, viewX, cxe, 0 ); + isApprox( t, viewY, cye, 5 ); t.strictEqual( out, cy1, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/lapack/base/crot/test/test.ndarray.js b/lib/node_modules/@stdlib/lapack/base/crot/test/test.ndarray.js index 35b67bd85266..9d43a074dda3 100644 --- a/lib/node_modules/@stdlib/lapack/base/crot/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/lapack/base/crot/test/test.ndarray.js @@ -24,11 +24,9 @@ var tape = require( 'tape' ); var Float32Array = require( '@stdlib/array/float32' ); var Complex64Array = require( '@stdlib/array/complex64' ); var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var EPS = require( '@stdlib/constants/float32/eps' ); -var absf = require( '@stdlib/math/base/special/absf' ); +var isAlmostSameValuef = require( '@stdlib/number/float32/base/assert/is-almost-same-value' ); var crot = require( './../lib/ndarray.js' ); - // FUNCTIONS // /** @@ -38,26 +36,17 @@ var crot = require( './../lib/ndarray.js' ); * @param {Object} t - test object * @param {Collection} actual - actual values * @param {Collection} expected - expected values -* @param {number} rtol - relative tolerance +* @param {NonNegativeInteger} ulp - maximum allowed ULP difference */ -function isApprox( t, actual, expected, rtol ) { - var delta; - var tol; +function isApprox( t, actual, expected, ulp ) { var i; t.strictEqual( actual.length, expected.length, 'returns expected value' ); for ( i = 0; i < expected.length; i++ ) { - if ( actual[ i ] === expected[ i ] ) { - t.strictEqual( actual[ i ], expected[ i ], 'returns expected value' ); - } else { - delta = absf( actual[ i ] - expected[ i ] ); - tol = rtol * EPS * absf( expected[ i ] ); - t.ok( delta <= tol, 'within tolerance. actual: '+actual[ i ]+'. expected: '+expected[ i ]+'. delta: '+delta+'. tol: '+tol+'.' ); - } + t.strictEqual( isAlmostSameValuef( actual[ i ], expected[ i ], ulp ), true, 'returns expected value' ); } } - // TESTS // tape( 'main export is a function', function test( t ) { @@ -129,8 +118,8 @@ tape( 'the function applies a plane rotation', function test( t ) { ]); out = crot( cx.length, cx, 1, 0, cy, 1, 0, 0.8, s ); - isApprox( t, viewX, cxe, 2.0 ); - isApprox( t, viewY, cye, 2.0 ); + isApprox( t, viewX, cxe, 0 ); + isApprox( t, viewY, cye, 1 ); t.strictEqual( out, cy, 'returns expected value' ); t.end(); }); @@ -192,8 +181,8 @@ tape( 'the function supports an `x` stride', function test( t ) { ]); out = crot( 2, cx, 2, 0, cy, 1, 0, 0.8, s ); - isApprox( t, viewX, cxe, 2.0 ); - isApprox( t, viewY, cye, 2.0 ); + isApprox( t, viewX, cxe, 0 ); + isApprox( t, viewY, cye, 1 ); t.strictEqual( out, cy, 'returns expected value' ); t.end(); }); @@ -255,8 +244,8 @@ tape( 'the function supports an `x` offset', function test( t ) { ]); out = crot( 3, cx, 1, 1, cy, 1, 0, 0.8, s ); - isApprox( t, viewX, cxe, 2.0 ); - isApprox( t, viewY, cye, 4.0 ); + isApprox( t, viewX, cxe, 0 ); + isApprox( t, viewY, cye, 5 ); t.strictEqual( out, cy, 'returns expected value' ); t.end(); }); @@ -318,8 +307,8 @@ tape( 'the function supports a `y` stride', function test( t ) { ]); out = crot( 2, cx, 1, 0, cy, 2, 0, 0.8, s ); - isApprox( t, viewX, cxe, 2.0 ); - isApprox( t, viewY, cye, 2.0 ); + isApprox( t, viewX, cxe, 0 ); + isApprox( t, viewY, cye, 1 ); t.strictEqual( out, cy, 'returns expected value' ); t.end(); }); @@ -381,8 +370,8 @@ tape( 'the function supports a `y` offset', function test( t ) { ]); out = crot( 2, cx, 2, 0, cy, -1, 1, 0.8, s ); - isApprox( t, viewX, cxe, 2.0 ); - isApprox( t, viewY, cye, 4.0 ); + isApprox( t, viewX, cxe, 0 ); + isApprox( t, viewY, cye, 5 ); t.strictEqual( out, cy, 'returns expected value' ); t.end(); }); @@ -490,8 +479,8 @@ tape( 'the function supports negative strides', function test( t ) { ]); out = crot( 2, cx, -1, 1, cy, -2, 2, 0.8, s ); - isApprox( t, viewX, cxe, 2.0 ); - isApprox( t, viewY, cye, 2.0 ); + isApprox( t, viewX, cxe, 0 ); + isApprox( t, viewY, cye, 1 ); t.strictEqual( out, cy, 'returns expected value' ); t.end(); }); @@ -553,8 +542,8 @@ tape( 'the function supports complex access patterns', function test( t ) { ]); out = crot( 2, cx, 2, 1, cy, 1, 2, 0.8, s ); - isApprox( t, viewX, cxe, 2.0 ); - isApprox( t, viewY, cye, 4.0 ); + isApprox( t, viewX, cxe, 0 ); + isApprox( t, viewY, cye, 5 ); t.strictEqual( out, cy, 'returns expected value' ); t.end(); }); From 3bc0361aa9b5ba07e4ef5ed9ec9d5a5f9354f24b Mon Sep 17 00:00:00 2001 From: Philipp Burckhardt Date: Mon, 21 Sep 2026 23:39:37 -0500 Subject: [PATCH 2/5] style: inline ULP values and remove isApprox helper Co-Authored-By: Claude Opus 5 (1M context) --- .../lapack/base/crot/test/test.crot.js | 108 ++++++++++++------ .../lapack/base/crot/test/test.ndarray.js | 97 ++++++++++------ 2 files changed, 135 insertions(+), 70 deletions(-) diff --git a/lib/node_modules/@stdlib/lapack/base/crot/test/test.crot.js b/lib/node_modules/@stdlib/lapack/base/crot/test/test.crot.js index 0e71b7755b70..f43db203752d 100644 --- a/lib/node_modules/@stdlib/lapack/base/crot/test/test.crot.js +++ b/lib/node_modules/@stdlib/lapack/base/crot/test/test.crot.js @@ -27,26 +27,6 @@ var Complex64 = require( '@stdlib/complex/float32/ctor' ); var isAlmostSameValuef = require( '@stdlib/number/float32/base/assert/is-almost-same-value' ); var crot = require( './../lib/crot.js' ); -// FUNCTIONS // - -/** -* Tests for element-wise approximate equality. -* -* @private -* @param {Object} t - test object -* @param {Collection} actual - actual values -* @param {Collection} expected - expected values -* @param {NonNegativeInteger} ulp - maximum allowed ULP difference -*/ -function isApprox( t, actual, expected, ulp ) { - var i; - - t.strictEqual( actual.length, expected.length, 'returns expected value' ); - for ( i = 0; i < expected.length; i++ ) { - t.strictEqual( isAlmostSameValuef( actual[ i ], expected[ i ], ulp ), true, 'returns expected value' ); - } -} - // TESTS // tape( 'main export is a function', function test( t ) { @@ -69,6 +49,7 @@ tape( 'the function applies a plane rotation', function test( t ) { var cx; var cy; var s; + var i; // Verify in octave with [0.8 0.6; -0.6 0.8] * [1+2i, 3+4i, 5+6i, 7+8i; 0 0 0 0] @@ -119,8 +100,14 @@ tape( 'the function applies a plane rotation', function test( t ) { ]); out = crot( cx.length, cx, 1, cy, 1, 0.8, s ); - isApprox( t, viewX, cxe, 0 ); - isApprox( t, viewY, cye, 1 ); + t.strictEqual( viewX.length, cxe.length, 'returns expected value' ); + for ( i = 0; i < cxe.length; i++ ) { + t.strictEqual( isAlmostSameValuef( viewX[ i ], cxe[ i ], 0 ), true, 'returns expected value' ); + } + t.strictEqual( viewY.length, cye.length, 'returns expected value' ); + for ( i = 0; i < cye.length; i++ ) { + t.strictEqual( isAlmostSameValuef( viewY[ i ], cye[ i ], 1 ), true, 'returns expected value' ); + } t.strictEqual( out, cy, 'returns expected value' ); t.end(); }); @@ -134,6 +121,7 @@ tape( 'the function applies a plane rotation', function test( t ) { var cx; var cy; var s; + var i; // Verify in octave with [1.25 0.75i; .75i 1.25] * [1+2i, 3+4i, 5+6i, 7+8i; 0 0 0 0] @@ -184,8 +172,14 @@ tape( 'the function applies a plane rotation', function test( t ) { ]); out = crot( cx.length, cx, 1, cy, 1, 1.25, s ); - isApprox( t, viewX, cxe, 0 ); - isApprox( t, viewY, cye, 0 ); + t.strictEqual( viewX.length, cxe.length, 'returns expected value' ); + for ( i = 0; i < cxe.length; i++ ) { + t.strictEqual( isAlmostSameValuef( viewX[ i ], cxe[ i ], 0 ), true, 'returns expected value' ); + } + t.strictEqual( viewY.length, cye.length, 'returns expected value' ); + for ( i = 0; i < cye.length; i++ ) { + t.strictEqual( isAlmostSameValuef( viewY[ i ], cye[ i ], 0 ), true, 'returns expected value' ); + } t.strictEqual( out, cy, 'returns expected value' ); t.end(); }); @@ -199,6 +193,7 @@ tape( 'the function applies a plane rotation', function test( t ) { var cx; var cy; var s; + var i; // Verify in octave with [1.25 0.3+0.4i; -0.3+0.4i 1.25] * [1+2i, 3+4i, 5+6i, 7+8i; 0 0 0 0] @@ -249,8 +244,14 @@ tape( 'the function applies a plane rotation', function test( t ) { ]); out = crot( cx.length, cx, 1, cy, 1, 1.25, s ); - isApprox( t, viewX, cxe, 0 ); - isApprox( t, viewY, cye, 5 ); + t.strictEqual( viewX.length, cxe.length, 'returns expected value' ); + for ( i = 0; i < cxe.length; i++ ) { + t.strictEqual( isAlmostSameValuef( viewX[ i ], cxe[ i ], 0 ), true, 'returns expected value' ); + } + t.strictEqual( viewY.length, cye.length, 'returns expected value' ); + for ( i = 0; i < cye.length; i++ ) { + t.strictEqual( isAlmostSameValuef( viewY[ i ], cye[ i ], 5 ), true, 'returns expected value' ); + } t.strictEqual( out, cy, 'returns expected value' ); t.end(); }); @@ -264,6 +265,7 @@ tape( 'the function supports an `x` stride', function test( t ) { var cx; var cy; var s; + var i; s = new Complex64( 0.3, 0.4 ); cx = new Complex64Array([ @@ -312,8 +314,14 @@ tape( 'the function supports an `x` stride', function test( t ) { ]); out = crot( 2, cx, 2, cy, 1, 0.8, s ); - isApprox( t, viewX, cxe, 0 ); - isApprox( t, viewY, cye, 5 ); + t.strictEqual( viewX.length, cxe.length, 'returns expected value' ); + for ( i = 0; i < cxe.length; i++ ) { + t.strictEqual( isAlmostSameValuef( viewX[ i ], cxe[ i ], 0 ), true, 'returns expected value' ); + } + t.strictEqual( viewY.length, cye.length, 'returns expected value' ); + for ( i = 0; i < cye.length; i++ ) { + t.strictEqual( isAlmostSameValuef( viewY[ i ], cye[ i ], 5 ), true, 'returns expected value' ); + } t.strictEqual( out, cy, 'returns expected value' ); t.end(); }); @@ -327,6 +335,7 @@ tape( 'the function supports a `y` stride', function test( t ) { var cx; var cy; var s; + var i; s = new Complex64( 0.3, 0.4 ); cx = new Complex64Array([ @@ -375,8 +384,14 @@ tape( 'the function supports a `y` stride', function test( t ) { ]); out = crot( 2, cx, 1, cy, 2, 0.8, s ); - isApprox( t, viewX, cxe, 0 ); - isApprox( t, viewY, cye, 1 ); + t.strictEqual( viewX.length, cxe.length, 'returns expected value' ); + for ( i = 0; i < cxe.length; i++ ) { + t.strictEqual( isAlmostSameValuef( viewX[ i ], cxe[ i ], 0 ), true, 'returns expected value' ); + } + t.strictEqual( viewY.length, cye.length, 'returns expected value' ); + for ( i = 0; i < cye.length; i++ ) { + t.strictEqual( isAlmostSameValuef( viewY[ i ], cye[ i ], 1 ), true, 'returns expected value' ); + } t.strictEqual( out, cy, 'returns expected value' ); t.end(); }); @@ -436,6 +451,7 @@ tape( 'the function supports negative strides', function test( t ) { var cx; var cy; var s; + var i; s = new Complex64( 0.3, 0.4 ); cx = new Complex64Array([ @@ -484,8 +500,14 @@ tape( 'the function supports negative strides', function test( t ) { ]); out = crot( 2, cx, -1, cy, -2, 0.8, s ); - isApprox( t, viewX, cxe, 0 ); - isApprox( t, viewY, cye, 1 ); + t.strictEqual( viewX.length, cxe.length, 'returns expected value' ); + for ( i = 0; i < cxe.length; i++ ) { + t.strictEqual( isAlmostSameValuef( viewX[ i ], cxe[ i ], 0 ), true, 'returns expected value' ); + } + t.strictEqual( viewY.length, cye.length, 'returns expected value' ); + for ( i = 0; i < cye.length; i++ ) { + t.strictEqual( isAlmostSameValuef( viewY[ i ], cye[ i ], 1 ), true, 'returns expected value' ); + } t.strictEqual( out, cy, 'returns expected value' ); t.end(); }); @@ -499,6 +521,7 @@ tape( 'the function supports complex access patterns', function test( t ) { var cx; var cy; var s; + var i; s = new Complex64( 0.3, 0.4 ); cx = new Complex64Array([ @@ -547,8 +570,14 @@ tape( 'the function supports complex access patterns', function test( t ) { ]); out = crot( 2, cx, 2, cy, -1, 0.8, s ); - isApprox( t, viewX, cxe, 0 ); - isApprox( t, viewY, cye, 5 ); + t.strictEqual( viewX.length, cxe.length, 'returns expected value' ); + for ( i = 0; i < cxe.length; i++ ) { + t.strictEqual( isAlmostSameValuef( viewX[ i ], cxe[ i ], 0 ), true, 'returns expected value' ); + } + t.strictEqual( viewY.length, cye.length, 'returns expected value' ); + for ( i = 0; i < cye.length; i++ ) { + t.strictEqual( isAlmostSameValuef( viewY[ i ], cye[ i ], 5 ), true, 'returns expected value' ); + } t.strictEqual( out, cy, 'returns expected value' ); t.end(); }); @@ -564,6 +593,7 @@ tape( 'the function supports view offsets', function test( t ) { var cye; var out; var s; + var i; s = new Complex64( 0.3, 0.4 ); @@ -618,8 +648,14 @@ tape( 'the function supports view offsets', function test( t ) { ]); out = crot( 2, cx1, -2, cy1, 1, 0.8, s ); - isApprox( t, viewX, cxe, 0 ); - isApprox( t, viewY, cye, 5 ); + t.strictEqual( viewX.length, cxe.length, 'returns expected value' ); + for ( i = 0; i < cxe.length; i++ ) { + t.strictEqual( isAlmostSameValuef( viewX[ i ], cxe[ i ], 0 ), true, 'returns expected value' ); + } + t.strictEqual( viewY.length, cye.length, 'returns expected value' ); + for ( i = 0; i < cye.length; i++ ) { + t.strictEqual( isAlmostSameValuef( viewY[ i ], cye[ i ], 5 ), true, 'returns expected value' ); + } t.strictEqual( out, cy1, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/lapack/base/crot/test/test.ndarray.js b/lib/node_modules/@stdlib/lapack/base/crot/test/test.ndarray.js index 9d43a074dda3..5fe0a0ba7186 100644 --- a/lib/node_modules/@stdlib/lapack/base/crot/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/lapack/base/crot/test/test.ndarray.js @@ -27,26 +27,6 @@ var Complex64 = require( '@stdlib/complex/float32/ctor' ); var isAlmostSameValuef = require( '@stdlib/number/float32/base/assert/is-almost-same-value' ); var crot = require( './../lib/ndarray.js' ); -// FUNCTIONS // - -/** -* Tests for element-wise approximate equality. -* -* @private -* @param {Object} t - test object -* @param {Collection} actual - actual values -* @param {Collection} expected - expected values -* @param {NonNegativeInteger} ulp - maximum allowed ULP difference -*/ -function isApprox( t, actual, expected, ulp ) { - var i; - - t.strictEqual( actual.length, expected.length, 'returns expected value' ); - for ( i = 0; i < expected.length; i++ ) { - t.strictEqual( isAlmostSameValuef( actual[ i ], expected[ i ], ulp ), true, 'returns expected value' ); - } -} - // TESTS // tape( 'main export is a function', function test( t ) { @@ -69,6 +49,7 @@ tape( 'the function applies a plane rotation', function test( t ) { var cx; var cy; var s; + var i; s = new Complex64( 0.6, 0.0 ); @@ -118,8 +99,14 @@ tape( 'the function applies a plane rotation', function test( t ) { ]); out = crot( cx.length, cx, 1, 0, cy, 1, 0, 0.8, s ); - isApprox( t, viewX, cxe, 0 ); - isApprox( t, viewY, cye, 1 ); + t.strictEqual( viewX.length, cxe.length, 'returns expected value' ); + for ( i = 0; i < cxe.length; i++ ) { + t.strictEqual( isAlmostSameValuef( viewX[ i ], cxe[ i ], 0 ), true, 'returns expected value' ); + } + t.strictEqual( viewY.length, cye.length, 'returns expected value' ); + for ( i = 0; i < cye.length; i++ ) { + t.strictEqual( isAlmostSameValuef( viewY[ i ], cye[ i ], 1 ), true, 'returns expected value' ); + } t.strictEqual( out, cy, 'returns expected value' ); t.end(); }); @@ -133,6 +120,7 @@ tape( 'the function supports an `x` stride', function test( t ) { var cx; var cy; var s; + var i; s = new Complex64( 0.0, 0.6 ); cx = new Complex64Array([ @@ -181,8 +169,14 @@ tape( 'the function supports an `x` stride', function test( t ) { ]); out = crot( 2, cx, 2, 0, cy, 1, 0, 0.8, s ); - isApprox( t, viewX, cxe, 0 ); - isApprox( t, viewY, cye, 1 ); + t.strictEqual( viewX.length, cxe.length, 'returns expected value' ); + for ( i = 0; i < cxe.length; i++ ) { + t.strictEqual( isAlmostSameValuef( viewX[ i ], cxe[ i ], 0 ), true, 'returns expected value' ); + } + t.strictEqual( viewY.length, cye.length, 'returns expected value' ); + for ( i = 0; i < cye.length; i++ ) { + t.strictEqual( isAlmostSameValuef( viewY[ i ], cye[ i ], 1 ), true, 'returns expected value' ); + } t.strictEqual( out, cy, 'returns expected value' ); t.end(); }); @@ -196,6 +190,7 @@ tape( 'the function supports an `x` offset', function test( t ) { var cx; var cy; var s; + var i; s = new Complex64( 0.3, 0.4 ); cx = new Complex64Array([ @@ -244,8 +239,14 @@ tape( 'the function supports an `x` offset', function test( t ) { ]); out = crot( 3, cx, 1, 1, cy, 1, 0, 0.8, s ); - isApprox( t, viewX, cxe, 0 ); - isApprox( t, viewY, cye, 5 ); + t.strictEqual( viewX.length, cxe.length, 'returns expected value' ); + for ( i = 0; i < cxe.length; i++ ) { + t.strictEqual( isAlmostSameValuef( viewX[ i ], cxe[ i ], 0 ), true, 'returns expected value' ); + } + t.strictEqual( viewY.length, cye.length, 'returns expected value' ); + for ( i = 0; i < cye.length; i++ ) { + t.strictEqual( isAlmostSameValuef( viewY[ i ], cye[ i ], 5 ), true, 'returns expected value' ); + } t.strictEqual( out, cy, 'returns expected value' ); t.end(); }); @@ -259,6 +260,7 @@ tape( 'the function supports a `y` stride', function test( t ) { var cx; var cy; var s; + var i; s = new Complex64( 0.3, 0.4 ); cx = new Complex64Array([ @@ -307,8 +309,14 @@ tape( 'the function supports a `y` stride', function test( t ) { ]); out = crot( 2, cx, 1, 0, cy, 2, 0, 0.8, s ); - isApprox( t, viewX, cxe, 0 ); - isApprox( t, viewY, cye, 1 ); + t.strictEqual( viewX.length, cxe.length, 'returns expected value' ); + for ( i = 0; i < cxe.length; i++ ) { + t.strictEqual( isAlmostSameValuef( viewX[ i ], cxe[ i ], 0 ), true, 'returns expected value' ); + } + t.strictEqual( viewY.length, cye.length, 'returns expected value' ); + for ( i = 0; i < cye.length; i++ ) { + t.strictEqual( isAlmostSameValuef( viewY[ i ], cye[ i ], 1 ), true, 'returns expected value' ); + } t.strictEqual( out, cy, 'returns expected value' ); t.end(); }); @@ -322,6 +330,7 @@ tape( 'the function supports a `y` offset', function test( t ) { var cx; var cy; var s; + var i; s = new Complex64( 0.3, 0.4 ); cx = new Complex64Array([ @@ -370,8 +379,14 @@ tape( 'the function supports a `y` offset', function test( t ) { ]); out = crot( 2, cx, 2, 0, cy, -1, 1, 0.8, s ); - isApprox( t, viewX, cxe, 0 ); - isApprox( t, viewY, cye, 5 ); + t.strictEqual( viewX.length, cxe.length, 'returns expected value' ); + for ( i = 0; i < cxe.length; i++ ) { + t.strictEqual( isAlmostSameValuef( viewX[ i ], cxe[ i ], 0 ), true, 'returns expected value' ); + } + t.strictEqual( viewY.length, cye.length, 'returns expected value' ); + for ( i = 0; i < cye.length; i++ ) { + t.strictEqual( isAlmostSameValuef( viewY[ i ], cye[ i ], 5 ), true, 'returns expected value' ); + } t.strictEqual( out, cy, 'returns expected value' ); t.end(); }); @@ -431,6 +446,7 @@ tape( 'the function supports negative strides', function test( t ) { var cx; var cy; var s; + var i; s = new Complex64( 0.3, 0.4 ); cx = new Complex64Array([ @@ -479,8 +495,14 @@ tape( 'the function supports negative strides', function test( t ) { ]); out = crot( 2, cx, -1, 1, cy, -2, 2, 0.8, s ); - isApprox( t, viewX, cxe, 0 ); - isApprox( t, viewY, cye, 1 ); + t.strictEqual( viewX.length, cxe.length, 'returns expected value' ); + for ( i = 0; i < cxe.length; i++ ) { + t.strictEqual( isAlmostSameValuef( viewX[ i ], cxe[ i ], 0 ), true, 'returns expected value' ); + } + t.strictEqual( viewY.length, cye.length, 'returns expected value' ); + for ( i = 0; i < cye.length; i++ ) { + t.strictEqual( isAlmostSameValuef( viewY[ i ], cye[ i ], 1 ), true, 'returns expected value' ); + } t.strictEqual( out, cy, 'returns expected value' ); t.end(); }); @@ -494,6 +516,7 @@ tape( 'the function supports complex access patterns', function test( t ) { var cx; var cy; var s; + var i; s = new Complex64( 0.3, 0.4 ); cx = new Complex64Array([ @@ -542,8 +565,14 @@ tape( 'the function supports complex access patterns', function test( t ) { ]); out = crot( 2, cx, 2, 1, cy, 1, 2, 0.8, s ); - isApprox( t, viewX, cxe, 0 ); - isApprox( t, viewY, cye, 5 ); + t.strictEqual( viewX.length, cxe.length, 'returns expected value' ); + for ( i = 0; i < cxe.length; i++ ) { + t.strictEqual( isAlmostSameValuef( viewX[ i ], cxe[ i ], 0 ), true, 'returns expected value' ); + } + t.strictEqual( viewY.length, cye.length, 'returns expected value' ); + for ( i = 0; i < cye.length; i++ ) { + t.strictEqual( isAlmostSameValuef( viewY[ i ], cye[ i ], 5 ), true, 'returns expected value' ); + } t.strictEqual( out, cy, 'returns expected value' ); t.end(); }); From f844f9d6fd044f053f9b7b0aaddb24cebbd519d8 Mon Sep 17 00:00:00 2001 From: Philipp Burckhardt Date: Mon, 21 Sep 2026 23:52:06 -0500 Subject: [PATCH 3/5] style: add missing blank lines before section headers Co-Authored-By: Claude Opus 5 (1M context) --- lib/node_modules/@stdlib/lapack/base/crot/test/test.crot.js | 1 + lib/node_modules/@stdlib/lapack/base/crot/test/test.ndarray.js | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/node_modules/@stdlib/lapack/base/crot/test/test.crot.js b/lib/node_modules/@stdlib/lapack/base/crot/test/test.crot.js index f43db203752d..054845dc07cc 100644 --- a/lib/node_modules/@stdlib/lapack/base/crot/test/test.crot.js +++ b/lib/node_modules/@stdlib/lapack/base/crot/test/test.crot.js @@ -27,6 +27,7 @@ var Complex64 = require( '@stdlib/complex/float32/ctor' ); var isAlmostSameValuef = require( '@stdlib/number/float32/base/assert/is-almost-same-value' ); var crot = require( './../lib/crot.js' ); + // TESTS // tape( 'main export is a function', function test( t ) { diff --git a/lib/node_modules/@stdlib/lapack/base/crot/test/test.ndarray.js b/lib/node_modules/@stdlib/lapack/base/crot/test/test.ndarray.js index 5fe0a0ba7186..c6b49570e57a 100644 --- a/lib/node_modules/@stdlib/lapack/base/crot/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/lapack/base/crot/test/test.ndarray.js @@ -27,6 +27,7 @@ var Complex64 = require( '@stdlib/complex/float32/ctor' ); var isAlmostSameValuef = require( '@stdlib/number/float32/base/assert/is-almost-same-value' ); var crot = require( './../lib/ndarray.js' ); + // TESTS // tape( 'main export is a function', function test( t ) { From fb5508f9fadab575a782476955bf09d0d0363d18 Mon Sep 17 00:00:00 2001 From: Philipp Burckhardt Date: Tue, 22 Sep 2026 00:13:47 -0500 Subject: [PATCH 4/5] revert: restore isApprox helper with inline ULP literals Co-Authored-By: Claude Opus 5 (1M context) --- .../lapack/base/crot/test/test.crot.js | 107 ++++++------------ .../lapack/base/crot/test/test.ndarray.js | 96 ++++++---------- 2 files changed, 68 insertions(+), 135 deletions(-) diff --git a/lib/node_modules/@stdlib/lapack/base/crot/test/test.crot.js b/lib/node_modules/@stdlib/lapack/base/crot/test/test.crot.js index 054845dc07cc..0e71b7755b70 100644 --- a/lib/node_modules/@stdlib/lapack/base/crot/test/test.crot.js +++ b/lib/node_modules/@stdlib/lapack/base/crot/test/test.crot.js @@ -27,6 +27,25 @@ var Complex64 = require( '@stdlib/complex/float32/ctor' ); var isAlmostSameValuef = require( '@stdlib/number/float32/base/assert/is-almost-same-value' ); var crot = require( './../lib/crot.js' ); +// FUNCTIONS // + +/** +* Tests for element-wise approximate equality. +* +* @private +* @param {Object} t - test object +* @param {Collection} actual - actual values +* @param {Collection} expected - expected values +* @param {NonNegativeInteger} ulp - maximum allowed ULP difference +*/ +function isApprox( t, actual, expected, ulp ) { + var i; + + t.strictEqual( actual.length, expected.length, 'returns expected value' ); + for ( i = 0; i < expected.length; i++ ) { + t.strictEqual( isAlmostSameValuef( actual[ i ], expected[ i ], ulp ), true, 'returns expected value' ); + } +} // TESTS // @@ -50,7 +69,6 @@ tape( 'the function applies a plane rotation', function test( t ) { var cx; var cy; var s; - var i; // Verify in octave with [0.8 0.6; -0.6 0.8] * [1+2i, 3+4i, 5+6i, 7+8i; 0 0 0 0] @@ -101,14 +119,8 @@ tape( 'the function applies a plane rotation', function test( t ) { ]); out = crot( cx.length, cx, 1, cy, 1, 0.8, s ); - t.strictEqual( viewX.length, cxe.length, 'returns expected value' ); - for ( i = 0; i < cxe.length; i++ ) { - t.strictEqual( isAlmostSameValuef( viewX[ i ], cxe[ i ], 0 ), true, 'returns expected value' ); - } - t.strictEqual( viewY.length, cye.length, 'returns expected value' ); - for ( i = 0; i < cye.length; i++ ) { - t.strictEqual( isAlmostSameValuef( viewY[ i ], cye[ i ], 1 ), true, 'returns expected value' ); - } + isApprox( t, viewX, cxe, 0 ); + isApprox( t, viewY, cye, 1 ); t.strictEqual( out, cy, 'returns expected value' ); t.end(); }); @@ -122,7 +134,6 @@ tape( 'the function applies a plane rotation', function test( t ) { var cx; var cy; var s; - var i; // Verify in octave with [1.25 0.75i; .75i 1.25] * [1+2i, 3+4i, 5+6i, 7+8i; 0 0 0 0] @@ -173,14 +184,8 @@ tape( 'the function applies a plane rotation', function test( t ) { ]); out = crot( cx.length, cx, 1, cy, 1, 1.25, s ); - t.strictEqual( viewX.length, cxe.length, 'returns expected value' ); - for ( i = 0; i < cxe.length; i++ ) { - t.strictEqual( isAlmostSameValuef( viewX[ i ], cxe[ i ], 0 ), true, 'returns expected value' ); - } - t.strictEqual( viewY.length, cye.length, 'returns expected value' ); - for ( i = 0; i < cye.length; i++ ) { - t.strictEqual( isAlmostSameValuef( viewY[ i ], cye[ i ], 0 ), true, 'returns expected value' ); - } + isApprox( t, viewX, cxe, 0 ); + isApprox( t, viewY, cye, 0 ); t.strictEqual( out, cy, 'returns expected value' ); t.end(); }); @@ -194,7 +199,6 @@ tape( 'the function applies a plane rotation', function test( t ) { var cx; var cy; var s; - var i; // Verify in octave with [1.25 0.3+0.4i; -0.3+0.4i 1.25] * [1+2i, 3+4i, 5+6i, 7+8i; 0 0 0 0] @@ -245,14 +249,8 @@ tape( 'the function applies a plane rotation', function test( t ) { ]); out = crot( cx.length, cx, 1, cy, 1, 1.25, s ); - t.strictEqual( viewX.length, cxe.length, 'returns expected value' ); - for ( i = 0; i < cxe.length; i++ ) { - t.strictEqual( isAlmostSameValuef( viewX[ i ], cxe[ i ], 0 ), true, 'returns expected value' ); - } - t.strictEqual( viewY.length, cye.length, 'returns expected value' ); - for ( i = 0; i < cye.length; i++ ) { - t.strictEqual( isAlmostSameValuef( viewY[ i ], cye[ i ], 5 ), true, 'returns expected value' ); - } + isApprox( t, viewX, cxe, 0 ); + isApprox( t, viewY, cye, 5 ); t.strictEqual( out, cy, 'returns expected value' ); t.end(); }); @@ -266,7 +264,6 @@ tape( 'the function supports an `x` stride', function test( t ) { var cx; var cy; var s; - var i; s = new Complex64( 0.3, 0.4 ); cx = new Complex64Array([ @@ -315,14 +312,8 @@ tape( 'the function supports an `x` stride', function test( t ) { ]); out = crot( 2, cx, 2, cy, 1, 0.8, s ); - t.strictEqual( viewX.length, cxe.length, 'returns expected value' ); - for ( i = 0; i < cxe.length; i++ ) { - t.strictEqual( isAlmostSameValuef( viewX[ i ], cxe[ i ], 0 ), true, 'returns expected value' ); - } - t.strictEqual( viewY.length, cye.length, 'returns expected value' ); - for ( i = 0; i < cye.length; i++ ) { - t.strictEqual( isAlmostSameValuef( viewY[ i ], cye[ i ], 5 ), true, 'returns expected value' ); - } + isApprox( t, viewX, cxe, 0 ); + isApprox( t, viewY, cye, 5 ); t.strictEqual( out, cy, 'returns expected value' ); t.end(); }); @@ -336,7 +327,6 @@ tape( 'the function supports a `y` stride', function test( t ) { var cx; var cy; var s; - var i; s = new Complex64( 0.3, 0.4 ); cx = new Complex64Array([ @@ -385,14 +375,8 @@ tape( 'the function supports a `y` stride', function test( t ) { ]); out = crot( 2, cx, 1, cy, 2, 0.8, s ); - t.strictEqual( viewX.length, cxe.length, 'returns expected value' ); - for ( i = 0; i < cxe.length; i++ ) { - t.strictEqual( isAlmostSameValuef( viewX[ i ], cxe[ i ], 0 ), true, 'returns expected value' ); - } - t.strictEqual( viewY.length, cye.length, 'returns expected value' ); - for ( i = 0; i < cye.length; i++ ) { - t.strictEqual( isAlmostSameValuef( viewY[ i ], cye[ i ], 1 ), true, 'returns expected value' ); - } + isApprox( t, viewX, cxe, 0 ); + isApprox( t, viewY, cye, 1 ); t.strictEqual( out, cy, 'returns expected value' ); t.end(); }); @@ -452,7 +436,6 @@ tape( 'the function supports negative strides', function test( t ) { var cx; var cy; var s; - var i; s = new Complex64( 0.3, 0.4 ); cx = new Complex64Array([ @@ -501,14 +484,8 @@ tape( 'the function supports negative strides', function test( t ) { ]); out = crot( 2, cx, -1, cy, -2, 0.8, s ); - t.strictEqual( viewX.length, cxe.length, 'returns expected value' ); - for ( i = 0; i < cxe.length; i++ ) { - t.strictEqual( isAlmostSameValuef( viewX[ i ], cxe[ i ], 0 ), true, 'returns expected value' ); - } - t.strictEqual( viewY.length, cye.length, 'returns expected value' ); - for ( i = 0; i < cye.length; i++ ) { - t.strictEqual( isAlmostSameValuef( viewY[ i ], cye[ i ], 1 ), true, 'returns expected value' ); - } + isApprox( t, viewX, cxe, 0 ); + isApprox( t, viewY, cye, 1 ); t.strictEqual( out, cy, 'returns expected value' ); t.end(); }); @@ -522,7 +499,6 @@ tape( 'the function supports complex access patterns', function test( t ) { var cx; var cy; var s; - var i; s = new Complex64( 0.3, 0.4 ); cx = new Complex64Array([ @@ -571,14 +547,8 @@ tape( 'the function supports complex access patterns', function test( t ) { ]); out = crot( 2, cx, 2, cy, -1, 0.8, s ); - t.strictEqual( viewX.length, cxe.length, 'returns expected value' ); - for ( i = 0; i < cxe.length; i++ ) { - t.strictEqual( isAlmostSameValuef( viewX[ i ], cxe[ i ], 0 ), true, 'returns expected value' ); - } - t.strictEqual( viewY.length, cye.length, 'returns expected value' ); - for ( i = 0; i < cye.length; i++ ) { - t.strictEqual( isAlmostSameValuef( viewY[ i ], cye[ i ], 5 ), true, 'returns expected value' ); - } + isApprox( t, viewX, cxe, 0 ); + isApprox( t, viewY, cye, 5 ); t.strictEqual( out, cy, 'returns expected value' ); t.end(); }); @@ -594,7 +564,6 @@ tape( 'the function supports view offsets', function test( t ) { var cye; var out; var s; - var i; s = new Complex64( 0.3, 0.4 ); @@ -649,14 +618,8 @@ tape( 'the function supports view offsets', function test( t ) { ]); out = crot( 2, cx1, -2, cy1, 1, 0.8, s ); - t.strictEqual( viewX.length, cxe.length, 'returns expected value' ); - for ( i = 0; i < cxe.length; i++ ) { - t.strictEqual( isAlmostSameValuef( viewX[ i ], cxe[ i ], 0 ), true, 'returns expected value' ); - } - t.strictEqual( viewY.length, cye.length, 'returns expected value' ); - for ( i = 0; i < cye.length; i++ ) { - t.strictEqual( isAlmostSameValuef( viewY[ i ], cye[ i ], 5 ), true, 'returns expected value' ); - } + isApprox( t, viewX, cxe, 0 ); + isApprox( t, viewY, cye, 5 ); t.strictEqual( out, cy1, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/lapack/base/crot/test/test.ndarray.js b/lib/node_modules/@stdlib/lapack/base/crot/test/test.ndarray.js index c6b49570e57a..9d43a074dda3 100644 --- a/lib/node_modules/@stdlib/lapack/base/crot/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/lapack/base/crot/test/test.ndarray.js @@ -27,6 +27,25 @@ var Complex64 = require( '@stdlib/complex/float32/ctor' ); var isAlmostSameValuef = require( '@stdlib/number/float32/base/assert/is-almost-same-value' ); var crot = require( './../lib/ndarray.js' ); +// FUNCTIONS // + +/** +* Tests for element-wise approximate equality. +* +* @private +* @param {Object} t - test object +* @param {Collection} actual - actual values +* @param {Collection} expected - expected values +* @param {NonNegativeInteger} ulp - maximum allowed ULP difference +*/ +function isApprox( t, actual, expected, ulp ) { + var i; + + t.strictEqual( actual.length, expected.length, 'returns expected value' ); + for ( i = 0; i < expected.length; i++ ) { + t.strictEqual( isAlmostSameValuef( actual[ i ], expected[ i ], ulp ), true, 'returns expected value' ); + } +} // TESTS // @@ -50,7 +69,6 @@ tape( 'the function applies a plane rotation', function test( t ) { var cx; var cy; var s; - var i; s = new Complex64( 0.6, 0.0 ); @@ -100,14 +118,8 @@ tape( 'the function applies a plane rotation', function test( t ) { ]); out = crot( cx.length, cx, 1, 0, cy, 1, 0, 0.8, s ); - t.strictEqual( viewX.length, cxe.length, 'returns expected value' ); - for ( i = 0; i < cxe.length; i++ ) { - t.strictEqual( isAlmostSameValuef( viewX[ i ], cxe[ i ], 0 ), true, 'returns expected value' ); - } - t.strictEqual( viewY.length, cye.length, 'returns expected value' ); - for ( i = 0; i < cye.length; i++ ) { - t.strictEqual( isAlmostSameValuef( viewY[ i ], cye[ i ], 1 ), true, 'returns expected value' ); - } + isApprox( t, viewX, cxe, 0 ); + isApprox( t, viewY, cye, 1 ); t.strictEqual( out, cy, 'returns expected value' ); t.end(); }); @@ -121,7 +133,6 @@ tape( 'the function supports an `x` stride', function test( t ) { var cx; var cy; var s; - var i; s = new Complex64( 0.0, 0.6 ); cx = new Complex64Array([ @@ -170,14 +181,8 @@ tape( 'the function supports an `x` stride', function test( t ) { ]); out = crot( 2, cx, 2, 0, cy, 1, 0, 0.8, s ); - t.strictEqual( viewX.length, cxe.length, 'returns expected value' ); - for ( i = 0; i < cxe.length; i++ ) { - t.strictEqual( isAlmostSameValuef( viewX[ i ], cxe[ i ], 0 ), true, 'returns expected value' ); - } - t.strictEqual( viewY.length, cye.length, 'returns expected value' ); - for ( i = 0; i < cye.length; i++ ) { - t.strictEqual( isAlmostSameValuef( viewY[ i ], cye[ i ], 1 ), true, 'returns expected value' ); - } + isApprox( t, viewX, cxe, 0 ); + isApprox( t, viewY, cye, 1 ); t.strictEqual( out, cy, 'returns expected value' ); t.end(); }); @@ -191,7 +196,6 @@ tape( 'the function supports an `x` offset', function test( t ) { var cx; var cy; var s; - var i; s = new Complex64( 0.3, 0.4 ); cx = new Complex64Array([ @@ -240,14 +244,8 @@ tape( 'the function supports an `x` offset', function test( t ) { ]); out = crot( 3, cx, 1, 1, cy, 1, 0, 0.8, s ); - t.strictEqual( viewX.length, cxe.length, 'returns expected value' ); - for ( i = 0; i < cxe.length; i++ ) { - t.strictEqual( isAlmostSameValuef( viewX[ i ], cxe[ i ], 0 ), true, 'returns expected value' ); - } - t.strictEqual( viewY.length, cye.length, 'returns expected value' ); - for ( i = 0; i < cye.length; i++ ) { - t.strictEqual( isAlmostSameValuef( viewY[ i ], cye[ i ], 5 ), true, 'returns expected value' ); - } + isApprox( t, viewX, cxe, 0 ); + isApprox( t, viewY, cye, 5 ); t.strictEqual( out, cy, 'returns expected value' ); t.end(); }); @@ -261,7 +259,6 @@ tape( 'the function supports a `y` stride', function test( t ) { var cx; var cy; var s; - var i; s = new Complex64( 0.3, 0.4 ); cx = new Complex64Array([ @@ -310,14 +307,8 @@ tape( 'the function supports a `y` stride', function test( t ) { ]); out = crot( 2, cx, 1, 0, cy, 2, 0, 0.8, s ); - t.strictEqual( viewX.length, cxe.length, 'returns expected value' ); - for ( i = 0; i < cxe.length; i++ ) { - t.strictEqual( isAlmostSameValuef( viewX[ i ], cxe[ i ], 0 ), true, 'returns expected value' ); - } - t.strictEqual( viewY.length, cye.length, 'returns expected value' ); - for ( i = 0; i < cye.length; i++ ) { - t.strictEqual( isAlmostSameValuef( viewY[ i ], cye[ i ], 1 ), true, 'returns expected value' ); - } + isApprox( t, viewX, cxe, 0 ); + isApprox( t, viewY, cye, 1 ); t.strictEqual( out, cy, 'returns expected value' ); t.end(); }); @@ -331,7 +322,6 @@ tape( 'the function supports a `y` offset', function test( t ) { var cx; var cy; var s; - var i; s = new Complex64( 0.3, 0.4 ); cx = new Complex64Array([ @@ -380,14 +370,8 @@ tape( 'the function supports a `y` offset', function test( t ) { ]); out = crot( 2, cx, 2, 0, cy, -1, 1, 0.8, s ); - t.strictEqual( viewX.length, cxe.length, 'returns expected value' ); - for ( i = 0; i < cxe.length; i++ ) { - t.strictEqual( isAlmostSameValuef( viewX[ i ], cxe[ i ], 0 ), true, 'returns expected value' ); - } - t.strictEqual( viewY.length, cye.length, 'returns expected value' ); - for ( i = 0; i < cye.length; i++ ) { - t.strictEqual( isAlmostSameValuef( viewY[ i ], cye[ i ], 5 ), true, 'returns expected value' ); - } + isApprox( t, viewX, cxe, 0 ); + isApprox( t, viewY, cye, 5 ); t.strictEqual( out, cy, 'returns expected value' ); t.end(); }); @@ -447,7 +431,6 @@ tape( 'the function supports negative strides', function test( t ) { var cx; var cy; var s; - var i; s = new Complex64( 0.3, 0.4 ); cx = new Complex64Array([ @@ -496,14 +479,8 @@ tape( 'the function supports negative strides', function test( t ) { ]); out = crot( 2, cx, -1, 1, cy, -2, 2, 0.8, s ); - t.strictEqual( viewX.length, cxe.length, 'returns expected value' ); - for ( i = 0; i < cxe.length; i++ ) { - t.strictEqual( isAlmostSameValuef( viewX[ i ], cxe[ i ], 0 ), true, 'returns expected value' ); - } - t.strictEqual( viewY.length, cye.length, 'returns expected value' ); - for ( i = 0; i < cye.length; i++ ) { - t.strictEqual( isAlmostSameValuef( viewY[ i ], cye[ i ], 1 ), true, 'returns expected value' ); - } + isApprox( t, viewX, cxe, 0 ); + isApprox( t, viewY, cye, 1 ); t.strictEqual( out, cy, 'returns expected value' ); t.end(); }); @@ -517,7 +494,6 @@ tape( 'the function supports complex access patterns', function test( t ) { var cx; var cy; var s; - var i; s = new Complex64( 0.3, 0.4 ); cx = new Complex64Array([ @@ -566,14 +542,8 @@ tape( 'the function supports complex access patterns', function test( t ) { ]); out = crot( 2, cx, 2, 1, cy, 1, 2, 0.8, s ); - t.strictEqual( viewX.length, cxe.length, 'returns expected value' ); - for ( i = 0; i < cxe.length; i++ ) { - t.strictEqual( isAlmostSameValuef( viewX[ i ], cxe[ i ], 0 ), true, 'returns expected value' ); - } - t.strictEqual( viewY.length, cye.length, 'returns expected value' ); - for ( i = 0; i < cye.length; i++ ) { - t.strictEqual( isAlmostSameValuef( viewY[ i ], cye[ i ], 5 ), true, 'returns expected value' ); - } + isApprox( t, viewX, cxe, 0 ); + isApprox( t, viewY, cye, 5 ); t.strictEqual( out, cy, 'returns expected value' ); t.end(); }); From 9f3fa65b67ca9359304225a317a93db6a49eb65a Mon Sep 17 00:00:00 2001 From: Philipp Burckhardt Date: Tue, 22 Sep 2026 00:19:03 -0500 Subject: [PATCH 5/5] style: fix blank lines before section headers Co-Authored-By: Claude Opus 5 (1M context) --- lib/node_modules/@stdlib/lapack/base/crot/test/test.crot.js | 2 ++ lib/node_modules/@stdlib/lapack/base/crot/test/test.ndarray.js | 2 ++ 2 files changed, 4 insertions(+) diff --git a/lib/node_modules/@stdlib/lapack/base/crot/test/test.crot.js b/lib/node_modules/@stdlib/lapack/base/crot/test/test.crot.js index 0e71b7755b70..9af4071af793 100644 --- a/lib/node_modules/@stdlib/lapack/base/crot/test/test.crot.js +++ b/lib/node_modules/@stdlib/lapack/base/crot/test/test.crot.js @@ -27,6 +27,7 @@ var Complex64 = require( '@stdlib/complex/float32/ctor' ); var isAlmostSameValuef = require( '@stdlib/number/float32/base/assert/is-almost-same-value' ); var crot = require( './../lib/crot.js' ); + // FUNCTIONS // /** @@ -47,6 +48,7 @@ function isApprox( t, actual, expected, ulp ) { } } + // TESTS // tape( 'main export is a function', function test( t ) { diff --git a/lib/node_modules/@stdlib/lapack/base/crot/test/test.ndarray.js b/lib/node_modules/@stdlib/lapack/base/crot/test/test.ndarray.js index 9d43a074dda3..de70e5104e4d 100644 --- a/lib/node_modules/@stdlib/lapack/base/crot/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/lapack/base/crot/test/test.ndarray.js @@ -27,6 +27,7 @@ var Complex64 = require( '@stdlib/complex/float32/ctor' ); var isAlmostSameValuef = require( '@stdlib/number/float32/base/assert/is-almost-same-value' ); var crot = require( './../lib/ndarray.js' ); + // FUNCTIONS // /** @@ -47,6 +48,7 @@ function isApprox( t, actual, expected, ulp ) { } } + // TESTS // tape( 'main export is a function', function test( t ) {