diff options
| author | ruki <[email protected]> | 2025-02-25 22:56:49 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-02-25 11:42:10 +0800 |
| commit | b5ec74aa63fd8c0888400a9b6bd075b19da5c4c3 (patch) | |
| tree | 72957fa7b6f4e929ee17847673b2034b6ac020f7 /tests/projects | |
| parent | 764a267a30d0ad8f6bb360562463d257594e2474 (diff) | |
select package version
Diffstat (limited to 'tests/projects')
| -rw-r--r-- | tests/projects/kotlin-native/package/src/main.kt | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/tests/projects/kotlin-native/package/src/main.kt b/tests/projects/kotlin-native/package/src/main.kt index 543f5ac8f..ec15ce26d 100644 --- a/tests/projects/kotlin-native/package/src/main.kt +++ b/tests/projects/kotlin-native/package/src/main.kt @@ -1,3 +1,23 @@ +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json + +@Serializable +private data class Message( + val topic: String, + val content: String, +) + +private val PrettyPrintJson = Json { + prettyPrint = true +} + fun main() { - println("hello xmake!") + val message = Message( + topic = "Kotlin/Native", + content = "Hello!" + ) + println(PrettyPrintJson.encodeToString(message)) } + + |
