Snapshot: summary-notify compiles + SummaryNotifyTest (compile+tests green)
This commit is contained in:
parent
add622d649
commit
5d1f615d4a
1 changed files with 7 additions and 6 deletions
|
|
@ -1,8 +1,9 @@
|
|||
package com.shonar.desktop
|
||||
|
||||
import kotlin.test.Test
|
||||
import kotlin.test.assertEquals
|
||||
import kotlin.test.assertTrue
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertNotEquals
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
|
||||
class SummaryNotifyTest {
|
||||
@Test fun `encode-decode roundtrip is sorted and stable`() {
|
||||
|
|
@ -12,14 +13,14 @@ class SummaryNotifyTest {
|
|||
}
|
||||
|
||||
@Test fun `decode tolerates garbage and null`() {
|
||||
assertEquals(emptySet(), SummaryNotify.decode(null))
|
||||
assertEquals(emptySet(), SummaryNotify.decode("not json"))
|
||||
assertEquals(emptySet<String>(), SummaryNotify.decode(null))
|
||||
assertEquals(emptySet<String>(), SummaryNotify.decode("not json"))
|
||||
assertEquals(setOf("x.m4a"), SummaryNotify.decode("""["x.m4a",""]"""))
|
||||
}
|
||||
|
||||
@Test fun `seenKey dedupes per version`() {
|
||||
assertEquals("f.m4a#3", SummaryNotify.seenKey("f.m4a", 3))
|
||||
assertTrue(SummaryNotify.seenKey("f.m4a", 3) != SummaryNotify.seenKey("f.m4a", 4))
|
||||
assertNotEquals(SummaryNotify.seenKey("f.m4a", 3), SummaryNotify.seenKey("f.m4a", 4))
|
||||
}
|
||||
|
||||
@Test fun `trimSeen keeps the newest entries`() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue