test: collapse exact-match guard in stats/base/dists/wald tests#11880
Merged
test: collapse exact-match guard in stats/base/dists/wald tests#11880
stats/base/dists/wald tests#11880Conversation
Propagates the test-assertion simplification from eeaf7c4 ("refactor: reduce number of arithmetic operations") to sibling Wald distribution packages (pdf, variance, skewness). Replaces the redundant `if ( y === expected[i] ) { t.strictEqual( y, ... ) } else { t.ok( isAlmostSameValue( y, expected[i], TOL ) ) }` block with an unconditional `t.strictEqual( isAlmostSameValue( y, expected[i], TOL ), true, ... )`, since `isAlmostSameValue` already accepts exact matches.
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
stats/base/dists/wald testsstats/base/dists/wald tests
kgryte
approved these changes
May 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This pull request:
developbetween 2026-05-01 02:09:52 -0700 and 2026-05-01 04:48:43 -0500 to sibling packages.stats/base/dists/wald: collapse exact-match-or-tolerance test guardPropagates the
eeaf7c4refactor fromstats/base/dists/wald/mode— which collapsed the branched exact-match-or-tolerance guard into a single unconditionalt.strictEqual( isAlmostSameValue( y, expected[i], TOL ), true, ... )— to the 7 test files acrossstats/base/dists/wald/pdf,stats/base/dists/wald/variance, andstats/base/dists/wald/skewness. The collapse is safe becauseisAlmostSameValue(a, a, tol)returnstruefor any finite tolerance, so the exact-match branch was always redundant.Source: eeaf7c4 (
refactor: reduce number of arithmetic operations)Targets:
lib/node_modules/@stdlib/stats/base/dists/wald/pdf/test/test.factory.jslib/node_modules/@stdlib/stats/base/dists/wald/pdf/test/test.native.jslib/node_modules/@stdlib/stats/base/dists/wald/pdf/test/test.pdf.jslib/node_modules/@stdlib/stats/base/dists/wald/skewness/test/test.jslib/node_modules/@stdlib/stats/base/dists/wald/skewness/test/test.native.jslib/node_modules/@stdlib/stats/base/dists/wald/variance/test/test.jslib/node_modules/@stdlib/stats/base/dists/wald/variance/test/test.native.jsRelated Issues
No.
Questions
No.
Other
Validation. Search scope was
lib/node_modules/@stdlib/stats/base/dists/wald/**/test/*.js. Two independent validation agents read each candidate file in full and confirmed the defect; an adaptation agent produced concrete patches preserving each site's tolerance andelse-branch message verbatim; a style-consistency agent checked indentation and spacing against the source commit's form. All 7 sites were unanimouslyconfirmedand self-contained within the target test file.Excluded.
dabdc73c(docs: update examples,ndarray/vector/ctor): thedtypes('real_and_generic')→dtypes('integer_and_generic')change pairs an integer-valueddiscreteUniformgenerator with the appropriate dtype filter. 4 textually similar example sites exist underndarray/base/{nullary,unary}-strided1d-dispatch{,-factory}, but each requires a judgment call about the example's intended dtype kind and was therefore deferred to manual review per the routine's high-signal-only criterion.642af215(docs: remove extra empty line,stats/base/ndarray/dmeanlipw/README.md): no remaining sibling READMEs with the<!-- /.c -->\n\n\n* * *double-blank-line pattern.eeaf7c48arithmetic-reduction part (3.0*r/2.0repeated subexpression inwald/mode/lib/main.jsandsrc/main.c): no other distribution function reuses that exact algebraic form.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was prepared by Claude Code as part of an automated fix-propagation routine: the recent
developcommit window was scanned for generalizable fixes, candidate sibling sites were enumerated byrg, and four parallel validation/adaptation/style agents independently confirmed each propagation site before the patches were applied.@stdlib-js/reviewers
Generated by Claude Code