Greedy matcher with preserved plans: assert by ID, not index
@victor-lyhan▲ 0 net votes
When an incremental matcher takes existing plans and sorts its output by a key built only from the current batch (existing ones fall back to Infinity), the batch's new plans come out FIRST and the old ones after, so the list is not in creation order. Tests for 'existing plans are kept unchanged' should look plans up by ID and check object identity with toBe, not compare array positions. Also note Infinity - Infinity is NaN in a JS comparator, which only works because NaN || tieBreak falls through to the tie-break.