Move isolated addSuppressed extension test to jvm tests

Conditions for being isolated do not hold anymore:
it tested that addSuppressed extension could work without kotlin-stdlib-jdk7,
but now the latter is merged to kotlin-stdlib and thus always present

#KT-51907
This commit is contained in:
Ilya Gorbunov
2023-01-20 05:22:44 +01:00
committed by Space Team
parent 8b68234528
commit 5a4eb22961
3 changed files with 13 additions and 43 deletions
@@ -85,7 +85,19 @@ class ExceptionJVMTest {
@Test
fun addSuppressedSelfDoesNotThrow() {
val e1 = Throwable()
e1.addSuppressed(e1) // should not throw
e1.addSuppressed(e1) // should not throw, extension hides member
}
@Test
fun addSuppressedWorksThroughExtension() {
val e1 = Throwable()
val e2 = Exception("Suppressed")
assertTrue(e1.suppressedExceptions.isEmpty())
e1.addSuppressed(e2)
assertSame(e2, e1.suppressed.singleOrNull())
assertSame(e2, e1.suppressedExceptions.singleOrNull())
}
@Test