-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix timelineaction deserialization for notifications
- Loading branch information
Showing
4 changed files
with
24 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
android/shared/src/commonTest/kotlin/io/rebble/cobble/data/TimelineActionTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package io.rebble.cobble.data | ||
|
||
import io.rebble.cobble.shared.data.TimelineAction | ||
import io.rebble.libpebblecommon.packets.blobdb.TimelineItem | ||
import kotlinx.serialization.encodeToString | ||
import kotlinx.serialization.json.Json | ||
import kotlin.test.Test | ||
import kotlin.test.assertEquals | ||
|
||
class TimelineActionTest { | ||
@Test | ||
fun test() { | ||
val action = TimelineAction(1, TimelineItem.Action.Type.Generic, emptyList()) | ||
val json = Json.encodeToString(action) | ||
println(json) | ||
val deserialized = Json.decodeFromString(TimelineAction.serializer(), json) | ||
println(deserialized) | ||
assertEquals(action, deserialized) | ||
} | ||
} |