From cdfc7ddb1743a936ee942e905c3a6a7e6276a089 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 28 Aug 2026 22:17:18 +0000 Subject: [PATCH] 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 Claude-Session: https://claude.ai/code/session_01MXpL2TPmSmxdv7eBwhWvJp --- .../trustedLists/TreasureMapEntryTest.kt | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/experimental/trustedLists/TreasureMapEntryTest.kt b/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/experimental/trustedLists/TreasureMapEntryTest.kt index 65707d8b99..b3336be932 100644 --- a/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/experimental/trustedLists/TreasureMapEntryTest.kt +++ b/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/experimental/trustedLists/TreasureMapEntryTest.kt @@ -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