diff --git a/libraries/stdlib/jdk7/build.gradle b/libraries/stdlib/jdk7/build.gradle index c95f2ed58ee..a37feb2d258 100644 --- a/libraries/stdlib/jdk7/build.gradle +++ b/libraries/stdlib/jdk7/build.gradle @@ -17,11 +17,6 @@ sourceSets { kotlin { } } - noJdk7Test { - kotlin { - srcDir 'testNoJdk7' - } - } java9 { java { srcDir 'java9' @@ -29,10 +24,6 @@ sourceSets { } } -configurations { - noJdk7TestApi.extendsFrom(testApi) -} - dependencies { api project(':kotlin-stdlib') testApi project(':kotlin-test:kotlin-test-junit') @@ -88,12 +79,4 @@ configureFrontendIr(project) LibrariesCommon.configureJava9Compilation(project, 'kotlin.stdlib.jdk7') -task testNoJdk7(type: Test, dependsOn: noJdk7TestClasses) { - group = "verification" - - testClassesDirs = sourceSets.noJdk7Test.output.classesDirs - classpath = sourceSets.noJdk7Test.runtimeClasspath -} - -check.dependsOn testNoJdk7 diff --git a/libraries/stdlib/jdk7/testNoJdk7/ExceptionTest.kt b/libraries/stdlib/jdk7/testNoJdk7/ExceptionTest.kt deleted file mode 100644 index 4d6da6f651e..00000000000 --- a/libraries/stdlib/jdk7/testNoJdk7/ExceptionTest.kt +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package test.exceptions - -import kotlin.addSuppressed as addSuppressedExtension -import kotlin.test.* - -class ExceptionTest { - - @Test - fun addSuppressedWorksWithoutJdk7Extensions() { - val e1 = Throwable() - val e2 = Exception("Suppressed") - - assertTrue(e1.suppressedExceptions.isEmpty()) - e1.addSuppressedExtension(e2) - - assertSame(e2, e1.suppressed.singleOrNull()) - assertSame(e2, e1.suppressedExceptions.singleOrNull()) - } - -} \ No newline at end of file diff --git a/libraries/stdlib/jvm/test/exceptions/ExceptionJVMTest.kt b/libraries/stdlib/jvm/test/exceptions/ExceptionJVMTest.kt index a6d726da43c..7e8286e34db 100644 --- a/libraries/stdlib/jvm/test/exceptions/ExceptionJVMTest.kt +++ b/libraries/stdlib/jvm/test/exceptions/ExceptionJVMTest.kt @@ -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