Add edge case test for stat wipe in progression calculations#134
Add edge case test for stat wipe in progression calculations#134
Conversation
Co-authored-by: Amund211 <14028449+Amund211@users.noreply.github.com>
Deploying rainbow with
|
| Latest commit: |
4612020
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://fbbb8c72.rainbow-ctx.pages.dev |
| Branch Preview URL: | https://copilot-add-edge-case-stat-w.rainbow-ctx.pages.dev |
Co-authored-by: Amund211 <14028449+Amund211@users.noreply.github.com>
Amund211
left a comment
There was a problem hiding this comment.
@copilot move the stats and player builders to the root of the function since these are shared and will not be mutated. Also move the history there. Then make an additional loop over exp, stars, and move the todo about index to there. Set the exp on the before player to 1000 stars. And 500 exp on the after player.
Done in 581e5e6. Moved builders and history to function root, added separate loop for experience/stars with 1000 stars (4,870,000 exp) on start player and 500 exp on end player. TODO about index moved to the experience/stars section. |
581e5e6 to
4612020
Compare
Adds test coverage for progression calculations when stats decrease from high values to zero/low values, simulating a stat reset/wipe scenario.
Changes
edge case: stat wipecovering 65 test combinations (11 gamemode stats × 5 gamemodes + 2 overall stats × 5 gamemodes)gamesPlayed,wins,losses,bedsBroken,bedsLost,finalKills,finalDeaths,kills,deaths,fkdr,kdrexperience,starsendValuematches expected values (0 for gamemode stats, 500 for experience, 1 for stars)winstreak(not implemented),index(not yet supported - noted in code)The progression calculation handles this edge case gracefully, returning negative
progressPerDayfor gamemode stats and appropriate values for experience/stars without crashing.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.