From 99b6b20aa61a28c9e5e537f86886fa00ab2e3f2c Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 8 Sep 2026 09:17:37 +0000 Subject: [PATCH 1/2] test: migrate `stats/incr/mskewness` to ULP-based assertions Ref: https://github.com/stdlib-js/stdlib/issues/11352 Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_014LzRJkRng6ssh3h5KCtY3y --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: skipped - task: lint_markdown_pkg_readmes status: na - task: lint_markdown_docs status: na - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/stats/incr/mskewness/test/test.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/node_modules/@stdlib/stats/incr/mskewness/test/test.js b/lib/node_modules/@stdlib/stats/incr/mskewness/test/test.js index 706e5f980351..ba19acc6cad0 100644 --- a/lib/node_modules/@stdlib/stats/incr/mskewness/test/test.js +++ b/lib/node_modules/@stdlib/stats/incr/mskewness/test/test.js @@ -21,8 +21,7 @@ // MODULES // var tape = require( 'tape' ); -var abs = require( '@stdlib/math/base/special/abs' ); -var EPS = require( '@stdlib/constants/float64/eps' ); +var isAlmostSameValue = require( '@stdlib/assert/is-almost-same-value' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var incrmskewness = require( './../lib' ); @@ -74,10 +73,9 @@ tape( 'the function returns an accumulator function', function test( t ) { tape( 'the accumulator function computes a moving corrected sample skewness incrementally', function test( t ) { var expected; var actual; - var delta; var data; + var ULP; var acc; - var tol; var i; var N; @@ -94,15 +92,14 @@ tape( 'the accumulator function computes a moving corrected sample skewness incr ]; acc = incrmskewness( 5 ); + ULP = 1; for ( i = 0; i < N; i++ ) { actual = acc( data[ i ] ); if ( expected[ i ] === null ) { t.strictEqual( actual, expected[i], 'returns expected value for index '+i ); } else { - delta = abs( actual - expected[ i ] ); - tol = 1.5 * EPS * abs( expected[ i ] ); - t.strictEqual( delta <= tol, true, 'within tolerance. Actual: '+actual+'. Expected: '+expected[i]+'. Delta: '+delta+'. Tol: '+tol+'.' ); + t.strictEqual( isAlmostSameValue( actual, expected[ i ], ULP ), true, 'returns expected value' ); } } From 23b27dea63b4c23804391d0093fdf69e04d3972b Mon Sep 17 00:00:00 2001 From: Athan Date: Tue, 8 Sep 2026 23:21:36 -0700 Subject: [PATCH 2/2] Apply batched suggestions from code review Co-authored-by: Athan Signed-off-by: Athan --- lib/node_modules/@stdlib/stats/incr/mskewness/test/test.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/node_modules/@stdlib/stats/incr/mskewness/test/test.js b/lib/node_modules/@stdlib/stats/incr/mskewness/test/test.js index ba19acc6cad0..309e789562f7 100644 --- a/lib/node_modules/@stdlib/stats/incr/mskewness/test/test.js +++ b/lib/node_modules/@stdlib/stats/incr/mskewness/test/test.js @@ -74,7 +74,6 @@ tape( 'the accumulator function computes a moving corrected sample skewness incr var expected; var actual; var data; - var ULP; var acc; var i; var N; @@ -92,14 +91,13 @@ tape( 'the accumulator function computes a moving corrected sample skewness incr ]; acc = incrmskewness( 5 ); - ULP = 1; for ( i = 0; i < N; i++ ) { actual = acc( data[ i ] ); if ( expected[ i ] === null ) { t.strictEqual( actual, expected[i], 'returns expected value for index '+i ); } else { - t.strictEqual( isAlmostSameValue( actual, expected[ i ], ULP ), true, 'returns expected value' ); + t.strictEqual( isAlmostSameValue( actual, expected[ i ], 1 ), true, 'returns expected value' ); } }