Skip to content

Enhance tests for WeightStore with new operations and metrics validation#44

Merged
TKorr merged 2 commits intomainfrom
try-insert-safety-d7ff7
Mar 1, 2026
Merged

Enhance tests for WeightStore with new operations and metrics validation#44
TKorr merged 2 commits intomainfrom
try-insert-safety-d7ff7

Conversation

@TKorr
Copy link
Contributor

@TKorr TKorr commented Mar 1, 2026

  • Added tests for weight tracking, including rejection of updates exceeding capacity.
  • Introduced metrics validation for insertions, removals, and evictions.
  • Implemented property-based tests to ensure state invariants under random operations.
  • Improved coverage for edge cases, such as zero weight capacity and weight overflow scenarios.

Description

Related Issue

Fixes #

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to change)
  • 📝 Documentation update
  • 🔧 Refactoring (no functional changes)
  • ⚡ Performance improvement
  • 🧪 Test addition or modification

How Has This Been Tested?

  • Unit tests
  • Integration tests
  • Manual testing

Test environment:

  • OS:
  • Rust version:

Checklist

  • My code follows the project's coding standards
  • I have run cargo fmt and cargo clippy
  • I have added tests for my changes
  • All new and existing tests pass (cargo test)
  • I have updated the documentation as needed
  • I have added an entry to CHANGELOG.md (if applicable)

Screenshots (if applicable)

Additional Notes

- Added tests for weight tracking, including rejection of updates exceeding capacity.
- Introduced metrics validation for insertions, removals, and evictions.
- Implemented property-based tests to ensure state invariants under random operations.
- Improved coverage for edge cases, such as zero weight capacity and weight overflow scenarios.
@TKorr TKorr self-assigned this Mar 1, 2026
- Reformatted assertions in the `weight_store_clear_resets_contents_but_preserves_counters` and `weight_store_clear_resets_contents_but_preserves_counters` tests for better clarity.
- Ensured consistent formatting across test cases to enhance maintainability and readability.
@TKorr TKorr merged commit baa57d6 into main Mar 1, 2026
16 checks passed
@TKorr TKorr deleted the try-insert-safety-d7ff7 branch March 1, 2026 20:15
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.

1 participant