Tests: minor, slightly move JDK path substitution logic

It will be used in other CLI tests in subsequent commits.
This commit is contained in:
Alexander Udalov
2024-02-14 15:21:48 +01:00
committed by Space Team
parent 60071cbb54
commit cdcb65c749
3 changed files with 5 additions and 5 deletions
@@ -70,15 +70,12 @@ abstract class AbstractJavaModulesIntegrationTest(
)
}
private fun checkKotlinOutput(moduleName: String): (String) -> Unit {
val expectedFirFile = File(testDataDirectory, "$moduleName.fir.txt")
return { actual ->
KotlinTestUtils.assertEqualsToFile(
if (languageVersion.usesK2 && expectedFirFile.exists()) expectedFirFile else File(testDataDirectory, "$moduleName.txt"),
getNormalizedCompilerOutput(actual, null, testDataPath, tmpdir.absolutePath)
.replace((System.getenv("JDK_11_0") ?: System.getenv("JDK_11")).replace("\\", "/"), "\$JDK11")
.replace((System.getenv("JDK_17_0") ?: System.getenv("JDK_17")).replace("\\", "/"), "\$JDK17")
)
}
}