test: Verify history count increments correctly after each advance_level#200
Open
gracious01-tech wants to merge 1 commit into
Open
test: Verify history count increments correctly after each advance_level#200gracious01-tech wants to merge 1 commit into
gracious01-tech wants to merge 1 commit into
Conversation
…e_level Add test_history_count_increments_correctly that asserts the count is 1 after the first advance_level call, 2 after the second, and 3 after the third.
|
@gracious01-tech Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
Description
Added a missing unit test to validate incremental behavior of
history_countafter eachadvance_levelcall.Previously, tests only asserted the final state (
history_count == 3) without verifying intermediate state transitions, which reduced confidence in step-by-step correctness.This PR introduces a deterministic test that validates each incremental update.
Related Issue
Closes #90
Type of Change
Changes Included
test_history_count_increments_correctly()advance_levelcall:Problem Solved
Previously:
== 3) was testedThis PR ensures correctness at every step of state mutation.
Security Impact
No security impact.
Improves correctness and predictability of contract state transitions.
Testing
advance_levelis 1advance_levelis 2advance_levelis 3Manual Testing Steps
advance_level()once → asserted history count = 1advance_level()twice → asserted history count = 2advance_level()three times → asserted history count = 3Acceptance Criteria Coverage
Breaking Changes
No breaking changes.
Checklist
Additional Context
This improves test granularity and ensures state transitions in
advance_levelare validated step-by-step rather than only verifying final aggregated state.Reviewer Notes
Please focus on: