Conversation
Strengthened `SeededRNG` normalization tests to verify documented uint32 coercion: float seed `42.999` matches `42`, `NaN` and `Infinity` seeds match `0`. Verified `nextInt(min === max)` does not advance RNG state and inverted bounds `nextInt(10, 1)` produces the same sequence as `nextInt(1, 10)`. Replaced `.not.toThrow()` in `invalid maxDice falls back to default` with a positive check that `DEFAULT_MAX_DICE+1` dice throws referencing `DEFAULT_MAX_DICE`. Replaced `result.degree.toBeDefined()` with `toBe(DegreeOfSuccess.Failure)` in the `max(1d20+5 vs 20, 0)` versus propagation test. Replaced three loose `toContain` checks in the CLI `--verbose` test with exact-match against the deterministic seeded output. Replaced `expect(true).toBe(false)` with `expect.unreachable(...)` in two `MockRNG` exhaustion tests.
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.
Audited the test suite for assertions weak enough to let real regressions pass and tightened the worst offenders. Test-only changes — no production code touched.
SeededRNGfloat /NaN/Infinityseed tests now assert documented uint32 coercion (SeededRNG(42.999)matchesSeededRNG(42);NaNandInfinitymatch0) instead of only same-seed reproducibility.nextInt(min === max)test asserts the trivial-range early-return does not advance RNG state; inverted-bounds test assertsnextInt(10, 1)produces the same sequence asnextInt(1, 10).invalid maxDice falls back to defaultrollsDEFAULT_MAX_DICE+1dice and asserts the error message referencesDEFAULT_MAX_DICE— proves the fallback used the documented default and notInfinity,0, or any other value.max(1d20+5 vs 20, 0)versus-propagation test assertsDegreeOfSuccess.Failureinstead oftoBeDefined().--verbosetest asserts the exact deterministic seeded output (4d6[3, 6, 3, (3)] = 12) instead of three loosetoContainchecks.MockRNGexhaustion tests useexpect.unreachable(...)instead ofexpect(true).toBe(false)for diagnostic failure messages.Closes #116
Drafted with AI assistance