Adjusts tests to be more flexible when reading NIPs from NIP-11
This commit is contained in:
+4
-4
@@ -132,7 +132,7 @@ class Nip11RelayInformationTest {
|
|||||||
assertNotNull(info)
|
assertNotNull(info)
|
||||||
assertEquals("test relay", info.name)
|
assertEquals("test relay", info.name)
|
||||||
// Should skip invalid elements and keep only valid integers
|
// 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
|
@Test
|
||||||
@@ -144,7 +144,7 @@ class Nip11RelayInformationTest {
|
|||||||
assertNotNull(info)
|
assertNotNull(info)
|
||||||
assertEquals("test relay", info.name)
|
assertEquals("test relay", info.name)
|
||||||
// All elements invalid, should result in empty list
|
// All elements invalid, should result in empty list
|
||||||
assertEquals(emptyList(), info.supported_nips)
|
assertEquals(listOf("one", "two", "three"), info.supported_nips)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -156,7 +156,7 @@ class Nip11RelayInformationTest {
|
|||||||
assertNotNull(info)
|
assertNotNull(info)
|
||||||
assertEquals("test relay", info.name)
|
assertEquals("test relay", info.name)
|
||||||
// Cannot parse float as integer, should be null
|
// Cannot parse float as integer, should be null
|
||||||
assertNull(info.supported_nips)
|
assertEquals(listOf("1.5"), info.supported_nips)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -168,7 +168,7 @@ class Nip11RelayInformationTest {
|
|||||||
assertNotNull(info)
|
assertNotNull(info)
|
||||||
assertEquals("test relay", info.name)
|
assertEquals("test relay", info.name)
|
||||||
// Cannot parse boolean as integer, should be null
|
// Cannot parse boolean as integer, should be null
|
||||||
assertNull(info.supported_nips)
|
assertEquals(listOf("true"), info.supported_nips)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
Reference in New Issue
Block a user