From b65546487d3fcbe556daff6c9eb7f61dd1d1c1e1 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Tue, 6 Jan 2026 18:57:56 -0500 Subject: [PATCH] Adjusts tests to be more flexible when reading NIPs from NIP-11 --- .../quartz/nip11RelayInfo/Nip11RelayInformationTest.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip11RelayInfo/Nip11RelayInformationTest.kt b/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip11RelayInfo/Nip11RelayInformationTest.kt index 75e267810..358474f3f 100644 --- a/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip11RelayInfo/Nip11RelayInformationTest.kt +++ b/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip11RelayInfo/Nip11RelayInformationTest.kt @@ -132,7 +132,7 @@ class Nip11RelayInformationTest { assertNotNull(info) assertEquals("test relay", info.name) // Should skip invalid elements and keep only valid integers - assertEquals(listOf("1", "3", "11"), info.supported_nips) + assertEquals(listOf("1", "invalid", "3", "4.5", "true", "11"), info.supported_nips) } @Test @@ -144,7 +144,7 @@ class Nip11RelayInformationTest { assertNotNull(info) assertEquals("test relay", info.name) // All elements invalid, should result in empty list - assertEquals(emptyList(), info.supported_nips) + assertEquals(listOf("one", "two", "three"), info.supported_nips) } @Test @@ -156,7 +156,7 @@ class Nip11RelayInformationTest { assertNotNull(info) assertEquals("test relay", info.name) // Cannot parse float as integer, should be null - assertNull(info.supported_nips) + assertEquals(listOf("1.5"), info.supported_nips) } @Test @@ -168,7 +168,7 @@ class Nip11RelayInformationTest { assertNotNull(info) assertEquals("test relay", info.name) // Cannot parse boolean as integer, should be null - assertNull(info.supported_nips) + assertEquals(listOf("true"), info.supported_nips) } @Test