Pin deck-shuffle diff behavior to a wholesale Replace

This commit is contained in:
jay
2026-11-28 16:14:19 -05:00
parent 1eb490d209
commit 6001741e10
@@ -78,6 +78,15 @@ class DeckRowDiffTest {
assertEquals(UpdateInstructions.Move(from = 1, to = 2), diffDeckRows(old, new))
}
@Test
fun `a deck shuffle permutation produces a Replace from the first divergence`() {
// A multi-element permutation is no single move; the drawer must re-render the
// shuffled region wholesale, which is coherent for a deliberate shuffle.
val old = listOf(fakeSong(), fakeSong(), fakeSong())
val new = old.reversed()
assertEquals(UpdateInstructions.Replace(from = 0), diffDeckRows(old, new))
}
@Test
fun `a replacement produces a Replace from the first divergence`() {
val old = listOf(fakeSong(), fakeSong(), fakeSong())