Pin deck-shuffle diff behavior to a wholesale Replace
This commit is contained in:
@@ -78,6 +78,15 @@ class DeckRowDiffTest {
|
|||||||
assertEquals(UpdateInstructions.Move(from = 1, to = 2), diffDeckRows(old, new))
|
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
|
@Test
|
||||||
fun `a replacement produces a Replace from the first divergence`() {
|
fun `a replacement produces a Replace from the first divergence`() {
|
||||||
val old = listOf(fakeSong(), fakeSong(), fakeSong())
|
val old = listOf(fakeSong(), fakeSong(), fakeSong())
|
||||||
|
|||||||
Reference in New Issue
Block a user