Resolve mutation in list_qualifies_for_extra_seat#3453
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3453 +/- ##
=======================================
Coverage 90.16% 90.17%
=======================================
Files 484 484
Lines 23914 23927 +13
Branches 2487 2487
=======================================
+ Hits 21563 21576 +13
Misses 2216 2216
Partials 135 135 ☔ View full report in Codecov by Harness. |
Lionqueen94
reviewed
Jun 20, 2026
…ment.rs Co-authored-by: Lionqueen94 <lionqueen94@gmail.com>
stacktraceghost
previously approved these changes
Jun 23, 2026
Lionqueen94
previously approved these changes
Jun 23, 2026
dcb94fb
stacktraceghost
approved these changes
Jun 25, 2026
Lionqueen94
approved these changes
Jun 25, 2026
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.
What & why
Kills a surviving mutation on
list_qualifies_for_extra_seatThe mutant changes==to!=on line 202 ofbackend/apportionment/src/seat_assignment/residual_seat_assignment.rsmaking it impossible for a seat to be reassigned to a list that had a seat assigned to it and which then was retracted.Now if anyone accidentally makes this change in the future, this unit test will flag it by failing.
closes #3446
closes #3355
Reviewer notes
list_qualifies_for_extra_seat(0, Some(1), &[previous_steps], 1u32),where
number_of_seats_largest_remainders = 0,number_of_seats_unique_highest_averages = Some(1),and
previous_stepsmakes surehas_retracted_seat = true,is the unique combination that makes
(has_retracted_seat && number_of_seats_unique_highest_averages == 1 && number_of_seats_largest_remainders <= 1)at line 202 of
residual_seat_assignment.rsreturn true.