From 63b1aad3ef9b53c1cb5deb2873d24e495e890012 Mon Sep 17 00:00:00 2001 From: LepilkinaElena Date: Wed, 18 Nov 2020 21:19:48 +0300 Subject: [PATCH] Added test to check fields deserialization from caches (#4540) --- kotlin-native/backend.native/tests/build.gradle | 4 ++++ .../tests/serialization/deserialized_fields.kt | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 kotlin-native/backend.native/tests/serialization/deserialized_fields.kt diff --git a/kotlin-native/backend.native/tests/build.gradle b/kotlin-native/backend.native/tests/build.gradle index 3822273d783..f900d0c96e3 100644 --- a/kotlin-native/backend.native/tests/build.gradle +++ b/kotlin-native/backend.native/tests/build.gradle @@ -3283,6 +3283,10 @@ task deserialized_listof0(type: KonanLocalTest) { source = "serialization/deserialized_listof0.kt" } +task deserialized_fields(type: KonanLocalTest) { + source = "serialization/deserialized_fields.kt" +} + task genKt39548 { doFirst { GenTestKT39548Kt.genTestKT39548(file("$buildDir/kt39548/kt39548.kt")) diff --git a/kotlin-native/backend.native/tests/serialization/deserialized_fields.kt b/kotlin-native/backend.native/tests/serialization/deserialized_fields.kt new file mode 100644 index 00000000000..4d9c85f8c77 --- /dev/null +++ b/kotlin-native/backend.native/tests/serialization/deserialized_fields.kt @@ -0,0 +1,16 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the LICENSE file. + */ +package serialization.deserialized_fields + +import kotlin.test.* + +class CustomThrowable(val extraInfo: String): Throwable("Some message", null) + +@Test fun runTest() { + val custom = CustomThrowable("Extra info") + assertEquals(custom.extraInfo, "Extra info") + assertEquals(custom.message, "Some message") + assertEquals(custom.cause, null) +} \ No newline at end of file