From 91e4bd0e7e82d0afe5193c96c5c8c876f4abf6f9 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 11 Sep 2026 14:19:59 +0000 Subject: [PATCH] test: migrate `stats/incr/nanmrss` to ULP-based assertions Migrate the tolerance-based assertion in `stats/incr/nanmrss` tests from a computed relative tolerance to a ULP-difference assertion using `@stdlib/assert/is-almost-same-value`. Ref: https://github.com/stdlib-js/stdlib/issues/11352 Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_014muLqDv12CgWqs2cpTH9vW --- 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/nanmrss/test/test.js | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/lib/node_modules/@stdlib/stats/incr/nanmrss/test/test.js b/lib/node_modules/@stdlib/stats/incr/nanmrss/test/test.js index c21d6c435cd9..dcf7b8dfe01a 100644 --- a/lib/node_modules/@stdlib/stats/incr/nanmrss/test/test.js +++ b/lib/node_modules/@stdlib/stats/incr/nanmrss/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 incrnanmrss = require( './../lib' ); @@ -72,10 +71,8 @@ tape( 'the function returns an accumulator function', function test( t ) { tape( 'the accumulator function computes a moving residual sum of squares incrementally', function test( t ) { var expected; var actual; - var delta; var data; var acc; - var tol; var N; var i; @@ -97,13 +94,7 @@ tape( 'the accumulator function computes a moving residual sum of squares increm expected = [ 1.0, 1.0, 1.0, 17.0, 26.0, 89.0, 89.0, 82.0, 154.0 ]; for ( i = 0; i < N; i++ ) { actual = acc( data[i][0], data[i][1] ); - if ( actual === expected[i] ) { - t.equal( actual, expected[i], 'returns expected value' ); - } else { - delta = abs( expected[i] - actual ); - tol = 1.0 * EPS * abs( expected[i] ); - t.equal( delta <= tol, true, 'within tolerance. Actual: '+actual+'. Expected: '+expected[i]+'. Delta: '+delta+'. Tol: '+tol+'.' ); - } + t.strictEqual( isAlmostSameValue( actual, expected[ i ], 0 ), true, 'returns expected value' ); } t.end(); });