fix: compute DiceRoll success count from fresh roll, not stale result (Closes #16) #39

Merged
shahondin1624 merged 1 commits from feature/issue-16-fix-diceroll-success-counting-bug into main 2026-03-13 12:22:57 +01:00

1 Commits

Author SHA1 Message Date
shahondin1624
1b75bc0b69 fix: compute DiceRoll success count from fresh roll, not stale result (Closes #16)
The DiceRoll.roll() method was counting successes from `this.result`
(the stale/empty list from before rolling) instead of the newly rolled
values. Fixed by capturing the new roll in a local variable before
passing it to copy(). Added 6 unit tests covering the fix.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 12:22:30 +01:00