Skip to content

Fix test data and comments in index calculation tests#137

Closed
Copilot wants to merge 4 commits intoindex-progressionfrom
copilot/fix-index-calculation-tests
Closed

Fix test data and comments in index calculation tests#137
Copilot wants to merge 4 commits intoindex-progressionfrom
copilot/fix-index-calculation-tests

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 16, 2026

Test cases had incorrect expected values and misleading comments due to miscalculations of stars from experience and progression rates.

Issues Fixed

Incorrect index calculations:

  • Line 1272: Expected index 16 with comment "4 stars" for 500 exp, but 500 exp = 1 star → index = 1 × 2² = 4
  • Line 1330: Comment "4 stars" for 0 exp, corrected to "0 stars"
  • Line 1272: Milestone adjusted from 20 to 10 to align with corrected index value

Incorrect formula coefficients:

  • Lines 1622, 1654: Formula used 0.1*t for stars/day, but calculation shows 0.05 stars/day (2435 exp / 4870 avg exp per star / 10 days)

Misleading comments:

  • Lines 1611, 1643: "0.5 stars per day" actually meant 0.5 total avg stars gained over 10 days (= 0.05 stars/day)

Variable naming:

  • Line 1737: discriminantsdiscriminant (function returns single value)

Example

// Before: incorrect star calculation and milestone
expected: {
    index: 16, // 4 stars * (2 fkdr)^2
    milestone: 20,
}

// After: correct calculation
expected: {
    index: 4, // 1 star * (2 fkdr)^2
    milestone: 10,
}
Original prompt

Check for any issues in the index calculation tests and fix them. The tests are verified working, but some of them may have minor issues. Check the test cases and the test implementation. Note that the code is not implemented so the tests will fail, just look for issues in the tests without running them


💡 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.

- Fixed line 1272: Updated comment from "4 stars" to "1 star" and index from 16 to 4
- Fixed line 1272: Updated milestone from 20 to 10 to match the corrected index
- Fixed line 1330: Updated comment from "4 stars" to "0 stars" (with 100 fkdr)

Co-authored-by: Amund211 <14028449+Amund211@users.noreply.github.com>
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Jan 16, 2026

Deploying rainbow with  Cloudflare Pages  Cloudflare Pages

Latest commit: fd77106
Status: ✅  Deploy successful!
Preview URL: https://529210d6.rainbow-ctx.pages.dev
Branch Preview URL: https://copilot-fix-index-calculatio.rainbow-ctx.pages.dev

View logs

Copilot AI and others added 2 commits January 16, 2026 07:45
Co-authored-by: Amund211 <14028449+Amund211@users.noreply.github.com>
- Fixed line 1611: Clarify "0.5 avg stars gained" instead of "0.5 stars per day"
- Fixed line 1622: Update formula from 0.1*t to 0.05*t (correct stars per day)
- Fixed line 1643: Clarify "0.5 avg stars gained" instead of "0.5 stars per day"
- Fixed line 1654: Update formula from 0.1*t to 0.05*t (correct stars per day)

Co-authored-by: Amund211 <14028449+Amund211@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix issues in index calculation tests Fix test data and comments in index calculation tests Jan 16, 2026
Copilot AI requested a review from Amund211 January 16, 2026 07:49
@Amund211 Amund211 requested a review from Copilot January 17, 2026 12:40
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes incorrect test data and misleading comments in index calculation tests. The changes correct mathematical errors in star-to-experience conversions and progression rate calculations.

Changes:

  • Corrected index calculation for 500 exp (1 star, not 4 stars) with adjusted milestone
  • Fixed comment describing 0 exp as "0 stars" instead of "4 stars"
  • Corrected formula coefficients from 0.1 to 0.05 stars/day in two test cases
  • Clarified comments to distinguish between total stars gained vs stars per day
  • Fixed variable naming from plural discriminants to singular discriminant

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Amund211
Copy link
Copy Markdown
Owner

Implemented back into #135

@Amund211 Amund211 closed this Jan 17, 2026
@Amund211 Amund211 deleted the copilot/fix-index-calculation-tests branch January 17, 2026 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants