Adds a test to check that Knapsack skips overweight groups and continues checking the remaining groups.
Mutant: Knapsack selection loop
if (group.m_weight > max_selection_weight) {
max_weight_exceeded = true;
- continue;
+ break;
}
I found this mutant on the mutation testing dashboard and confirmed it still survives on current master by applying it and running the five wallet test suites. All five passed with the mutant.
With this mutant, the loop stops at an overweight group instead of skipping it, potentially missing valid groups later in the list.
The test uses 10 overweight groups and one valid group. Since Knapsack shuffles groups randomly, it runs several times so that in some runs, overweight groups come before the valid one.
The test passes on master and fails with the mutant applied, producing critical check result has failed.