diff --git a/app/src/test/java/org/oxycblt/auxio/playback/queue/DeckRowDiffTest.kt b/app/src/test/java/org/oxycblt/auxio/playback/queue/DeckRowDiffTest.kt index 79843f5ff..3f5d3545e 100644 --- a/app/src/test/java/org/oxycblt/auxio/playback/queue/DeckRowDiffTest.kt +++ b/app/src/test/java/org/oxycblt/auxio/playback/queue/DeckRowDiffTest.kt @@ -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())