summaryrefslogtreecommitdiff
path: root/engine/src/test
diff options
context:
space:
mode:
authorSho Sakuma <me@m1sk9.dev>2026-08-02 19:10:46 +0900
committerSho Sakuma <me@m1sk9.dev>2026-08-02 19:10:56 +0900
commitbc0d7d522e169f3eeb8d5b632ee673392060694b (patch)
tree3cd616cc96904964a20bab267dc5112ba4719d6d /engine/src/test
parent1dd2787059331db57049cb1dac8a38ceea859992 (diff)
downloadLunaticChat-bc0d7d522e169f3eeb8d5b632ee673392060694b.tar.gz
LunaticChat-bc0d7d522e169f3eeb8d5b632ee673392060694b.tar.bz2
LunaticChat-bc0d7d522e169f3eeb8d5b632ee673392060694b.zip
refactor: remove code that no production path reaches
These were all scaffolding that drifted out of use, and each one costs a reader time before they discover it does nothing: - UUIDASStringSerializer duplicated UUIDSerializer byte for byte; the differing descriptor name never reaches the JSON/YAML wire format, so the choice between them was a coin flip for contributors. - Velocity's BuildInfo was never referenced (the plugin reads its version from PluginContainer) and read a "commit" property the build never wrote, so it would have reported "unknown" had anyone called it. - KanaConverter.TrieNode.Leaf is never constructed: buildTrie starts from a Branch and insert only ever returns Branch. Six branches guarded against a state the type system allowed but the code could not produce. With those gone, isValidRomaji and toHiragana were visibly the same trie walk, so they now share one longestMatch. - @Deprecated command handling had no annotated command to act on. - The settings backup restore looked for *.backup.* files that nothing in the repository writes, so it always fell through to empty settings. Also drops CommandContext.replyWithEvent/replyPlain, PluginCoroutineScope's unused plugin parameter, GitHubRelease fields no caller reads, and four language keys with no lookup site. Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat (limited to 'engine/src/test')
-rw-r--r--engine/src/test/kotlin/dev/m1sk9/lunaticChat/engine/settings/UUIDSerializerTest.kt44
1 files changed, 0 insertions, 44 deletions
diff --git a/engine/src/test/kotlin/dev/m1sk9/lunaticChat/engine/settings/UUIDSerializerTest.kt b/engine/src/test/kotlin/dev/m1sk9/lunaticChat/engine/settings/UUIDSerializerTest.kt
index 599a372..58d9c32 100644
--- a/engine/src/test/kotlin/dev/m1sk9/lunaticChat/engine/settings/UUIDSerializerTest.kt
+++ b/engine/src/test/kotlin/dev/m1sk9/lunaticChat/engine/settings/UUIDSerializerTest.kt
@@ -16,12 +16,6 @@ class UUIDSerializerTest {
val uuid: UUID,
)
- @Serializable
- private data class UUIDAsStringHolder(
- @Serializable(with = UUIDASStringSerializer::class)
- val uuid: UUID,
- )
-
@Test
fun `UUIDSerializer should serialize UUID to string`() {
val uuid = UUID.fromString("12345678-1234-1234-1234-123456789abc")
@@ -52,35 +46,6 @@ class UUIDSerializerTest {
}
@Test
- fun `UUIDASStringSerializer should serialize UUID to string`() {
- val uuid = UUID.fromString("abcdef01-2345-6789-abcd-ef0123456789")
- val holder = UUIDAsStringHolder(uuid)
-
- val jsonString = json.encodeToString(UUIDAsStringHolder.serializer(), holder)
-
- assert(jsonString.contains("abcdef01-2345-6789-abcd-ef0123456789"))
- }
-
- @Test
- fun `UUIDASStringSerializer should deserialize string to UUID`() {
- val jsonString = """{"uuid":"abcdef01-2345-6789-abcd-ef0123456789"}"""
- val holder = json.decodeFromString(UUIDAsStringHolder.serializer(), jsonString)
-
- assertEquals(UUID.fromString("abcdef01-2345-6789-abcd-ef0123456789"), holder.uuid)
- }
-
- @Test
- fun `UUIDASStringSerializer round-trip should preserve UUID`() {
- val originalUuid = UUID.randomUUID()
- val holder = UUIDAsStringHolder(originalUuid)
-
- val jsonString = json.encodeToString(UUIDAsStringHolder.serializer(), holder)
- val decoded = json.decodeFromString(UUIDAsStringHolder.serializer(), jsonString)
-
- assertEquals(originalUuid, decoded.uuid)
- }
-
- @Test
fun `UUIDSerializer should fail on invalid UUID string`() {
val jsonString = """{"uuid":"not-a-valid-uuid"}"""
@@ -88,13 +53,4 @@ class UUIDSerializerTest {
json.decodeFromString(UUIDHolder.serializer(), jsonString)
}
}
-
- @Test
- fun `UUIDASStringSerializer should fail on invalid UUID string`() {
- val jsonString = """{"uuid":"not-a-valid-uuid"}"""
-
- assertFailsWith<Exception> {
- json.decodeFromString(UUIDAsStringHolder.serializer(), jsonString)
- }
- }
}