summaryrefslogtreecommitdiff
path: root/formats/json-tests/commonTest/src/kotlinx/serialization/json/JsonTreeImplicitNullsTest.kt
diff options
context:
space:
mode:
Diffstat (limited to 'formats/json-tests/commonTest/src/kotlinx/serialization/json/JsonTreeImplicitNullsTest.kt')
-rw-r--r--formats/json-tests/commonTest/src/kotlinx/serialization/json/JsonTreeImplicitNullsTest.kt14
1 files changed, 14 insertions, 0 deletions
diff --git a/formats/json-tests/commonTest/src/kotlinx/serialization/json/JsonTreeImplicitNullsTest.kt b/formats/json-tests/commonTest/src/kotlinx/serialization/json/JsonTreeImplicitNullsTest.kt
new file mode 100644
index 00000000..995459e3
--- /dev/null
+++ b/formats/json-tests/commonTest/src/kotlinx/serialization/json/JsonTreeImplicitNullsTest.kt
@@ -0,0 +1,14 @@
+package kotlinx.serialization.json
+
+import kotlinx.serialization.KSerializer
+
+class JsonTreeImplicitNullsTest: AbstractJsonImplicitNullsTest() {
+ override fun <T> Json.encode(value: T, serializer: KSerializer<T>): String {
+ return encodeToJsonElement(serializer, value).toString()
+ }
+
+ override fun <T> Json.decode(json: String, serializer: KSerializer<T>): T {
+ val jsonElement = parseToJsonElement(json)
+ return decodeFromJsonElement(serializer, jsonElement)
+ }
+}