Fix IdeaModuleInfoTest.testSdkForScript in 193

There's automatic jdk 7 registration starting from 193.
This commit is contained in:
Nikolay Krasko
2019-10-30 12:10:34 +03:00
committed by Nikolay Krasko
parent c9793e4bf4
commit 0d2e790b32
@@ -39,7 +39,6 @@ import org.junit.runner.RunWith
@RunWith(JUnit3WithIdeaConfigurationRunner::class)
class IdeaModuleInfoTest : ModuleTestCase() {
fun testSimpleModuleDependency() {
val (a, b) = modules()
b.addDependency(a)
@@ -346,13 +345,18 @@ class IdeaModuleInfoTest : ModuleTestCase() {
}
fun testSdkForScript() {
// The first known jdk will be used for scripting if there is no jdk in the project
runWriteAction {
ProjectJdkTable.getInstance().addJdk(mockJdk6())
ProjectJdkTable.getInstance().addJdk(mockJdk9())
ProjectRootManager.getInstance(project).projectSdk = null
}
val firstSDK = ProjectJdkTable.getInstance().allJdks.first()
with(createFileInProject("script.kts").moduleInfo) {
dependencies().filterIsInstance<SdkInfo>().single { it.sdk == mockJdk6() }
dependencies().filterIsInstance<SdkInfo>().single { it.sdk == firstSDK }
}
}