mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-10-05 19:28:25 +00:00
test(quartz): drop a redundant safe call the compiler flagged
assertTrue(entry?.isGeneric == true) smart-casts entry to non-null, so the next line's ?. was dead and the build warned on it. Assert non-nullness once up front and read the fields plainly. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MXpL2TPmSmxdv7eBwhWvJp
This commit is contained in:
+7
-6
@@ -40,6 +40,7 @@ import kotlin.test.assertEquals
|
||||
import kotlin.test.assertFailsWith
|
||||
import kotlin.test.assertFalse
|
||||
import kotlin.test.assertIs
|
||||
import kotlin.test.assertNotNull
|
||||
import kotlin.test.assertNull
|
||||
import kotlin.test.assertTrue
|
||||
|
||||
@@ -70,13 +71,13 @@ class TreasureMapEntryTest {
|
||||
|
||||
@Test
|
||||
fun readsTheGenericBareKindEntry() {
|
||||
val entry = map(arrayOf("30392", publisher, nip85)).publicTrustedListProvider(UserTrustedListEvent.KIND)
|
||||
val entry = assertNotNull(map(arrayOf("30392", publisher, nip85)).publicTrustedListProvider(UserTrustedListEvent.KIND))
|
||||
|
||||
assertEquals(UserTrustedListEvent.KIND, entry?.kind)
|
||||
assertEquals(publisher, entry?.pubkey)
|
||||
assertEquals("$nip85/", entry?.relayUrl?.url)
|
||||
assertTrue(entry?.isGeneric == true)
|
||||
assertNull(entry?.name)
|
||||
assertEquals(UserTrustedListEvent.KIND, entry.kind)
|
||||
assertEquals(publisher, entry.pubkey)
|
||||
assertEquals("$nip85/", entry.relayUrl?.url)
|
||||
assertTrue(entry.isGeneric)
|
||||
assertNull(entry.name)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user