Add test coverage and fix handling for zero value progression calculations#133
Draft
Add test coverage and fix handling for zero value progression calculations#133
Conversation
- Added "edge case - zero current value" tests for linear gamemode stats - Added "edge case - zero current value" tests for quotient stats (fkdr, kdr) - Added "edge case - zero current value" tests for stars/exp - All tests document the actual behavior when current values are 0 - Tests cover all gamemodes (solo, doubles, threes, fours, overall) Co-authored-by: Amund211 <14028449+Amund211@users.noreply.github.com>
Deploying rainbow with
|
| Latest commit: |
41a3374
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://c124b34e.rainbow-ctx.pages.dev |
| Branch Preview URL: | https://copilot-add-progression-test.rainbow-ctx.pages.dev |
Copilot
AI
changed the title
[WIP] Add test cases for progression tests with current value 0
Add test coverage for progression calculations with zero current values
Jan 12, 2026
- Changed test cases: start and end values are both 0 (no decrease in stats) - Updated test expectations: milestone is 1 when value is 0, daysUntilMilestone is Infinity - Fixed implementation: handle endValue === 0 case with milestone of 1 - Removed "no progress" from error cases as it now returns valid result with infinite time - All 463 tests pass Co-authored-by: Amund211 <14028449+Amund211@users.noreply.github.com>
Contributor
Author
Updated the test cases and implementation in commit 41a3374:
All 463 tests pass. |
Copilot
AI
changed the title
Add test coverage for progression calculations with zero current values
Add test coverage and fix handling for zero value progression calculations
Jan 13, 2026
Owner
|
zero value tests should probably just be just a special case of the no progress cases, which should return a milestone and infinite expected time instead of a no progress error |
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.
Adds comprehensive test cases for progression calculations when
endValueis 0, covering normal stats, quotient stats (fkdr/kdr), and stars/experience. Also fixes the implementation to properly handle zero values with appropriate milestones.Changes
Linear stats: 45 test cases covering all 9 stats × 5 gamemodes
Quotient stats: 10 test cases for fkdr/kdr × 5 gamemodes
Stars/Experience: 10 test cases × 5 gamemodes
Implementation fix: Updated
progression.tsto handleendValue === 0caseMath.log10(0)which causes NaN valuesExample test structure:
Total: 65 new test cases. All 463 tests pass.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.