Minor: fix IDEA warnings in BasicBoxTest.kt
This commit is contained in:
Generated
+4
@@ -2,9 +2,13 @@
|
|||||||
<dictionary name="bashor">
|
<dictionary name="bashor">
|
||||||
<words>
|
<words>
|
||||||
<w>ctor</w>
|
<w>ctor</w>
|
||||||
|
<w>inlining</w>
|
||||||
<w>interner</w>
|
<w>interner</w>
|
||||||
<w>kclass</w>
|
<w>kclass</w>
|
||||||
<w>lookups</w>
|
<w>lookups</w>
|
||||||
|
<w>minification</w>
|
||||||
|
<w>minifier</w>
|
||||||
|
<w>minify</w>
|
||||||
<w>unescape</w>
|
<w>unescape</w>
|
||||||
</words>
|
</words>
|
||||||
</dictionary>
|
</dictionary>
|
||||||
|
|||||||
@@ -273,9 +273,7 @@ abstract class BasicBoxTest(
|
|||||||
return getTestName(true) + outputFileSuffix
|
return getTestName(true) + outputFileSuffix
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun TestModule.outputFileName(directory: File): String {
|
private fun TestModule.outputFileName(directory: File) = directory.absolutePath + "/" + outputFileSimpleName() + "_v5"
|
||||||
return directory.absolutePath + "/" + outputFileSimpleName() + "_v5"
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun generateJavaScriptFile(
|
private fun generateJavaScriptFile(
|
||||||
directory: String,
|
directory: String,
|
||||||
@@ -382,7 +380,7 @@ abstract class BasicBoxTest(
|
|||||||
|
|
||||||
class IncrementalData(var header: ByteArray? = null, val translatedFiles: MutableMap<File, TranslationResultValue> = hashMapOf())
|
class IncrementalData(var header: ByteArray? = null, val translatedFiles: MutableMap<File, TranslationResultValue> = hashMapOf())
|
||||||
|
|
||||||
protected fun translateFiles(
|
private fun translateFiles(
|
||||||
units: List<TranslationUnit>,
|
units: List<TranslationUnit>,
|
||||||
outputFile: File,
|
outputFile: File,
|
||||||
config: JsConfig,
|
config: JsConfig,
|
||||||
@@ -435,7 +433,7 @@ abstract class BasicBoxTest(
|
|||||||
checkSourceMap(outputFile, translationResult.program)
|
checkSourceMap(outputFile, translationResult.program)
|
||||||
}
|
}
|
||||||
|
|
||||||
protected fun processJsProgram(program: JsProgram, psiFiles: List<KtFile>) {
|
private fun processJsProgram(program: JsProgram, psiFiles: List<KtFile>) {
|
||||||
psiFiles.asSequence()
|
psiFiles.asSequence()
|
||||||
.map { it.text }
|
.map { it.text }
|
||||||
.forEach { DirectiveTestUtils.processDirectives(program, it) }
|
.forEach { DirectiveTestUtils.processDirectives(program, it) }
|
||||||
@@ -598,7 +596,7 @@ abstract class BasicBoxTest(
|
|||||||
val boxFunction = ktFile.declarations.find { it is KtNamedFunction && it.name == TEST_FUNCTION }
|
val boxFunction = ktFile.declarations.find { it is KtNamedFunction && it.name == TEST_FUNCTION }
|
||||||
if (boxFunction != null) {
|
if (boxFunction != null) {
|
||||||
testPackage = ktFile.packageFqName.asString()
|
testPackage = ktFile.packageFqName.asString()
|
||||||
if (testPackage?.isEmpty() ?: false) {
|
if (testPackage?.isEmpty() == true) {
|
||||||
testPackage = null
|
testPackage = null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -629,9 +627,8 @@ abstract class BasicBoxTest(
|
|||||||
return TestFile(temporaryFile.absolutePath, currentModule, recompile = RECOMPILE_PATTERN.matcher(text).find())
|
return TestFile(temporaryFile.absolutePath, currentModule, recompile = RECOMPILE_PATTERN.matcher(text).find())
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun createModule(name: String, dependencies: List<String>, friends: List<String>): TestModule? {
|
override fun createModule(name: String, dependencies: List<String>, friends: List<String>) =
|
||||||
return TestModule(name, dependencies, friends)
|
TestModule(name, dependencies, friends)
|
||||||
}
|
|
||||||
|
|
||||||
override fun close() {
|
override fun close() {
|
||||||
FileUtil.delete(tmpDir)
|
FileUtil.delete(tmpDir)
|
||||||
@@ -660,9 +657,8 @@ abstract class BasicBoxTest(
|
|||||||
val hasFilesToRecompile get() = files.any { it.recompile }
|
val hasFilesToRecompile get() = files.any { it.recompile }
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun createEnvironment(): KotlinCoreEnvironment {
|
override fun createEnvironment() =
|
||||||
return KotlinCoreEnvironment.createForTests(testRootDisposable, CompilerConfiguration(), EnvironmentConfigFiles.JS_CONFIG_FILES)
|
KotlinCoreEnvironment.createForTests(testRootDisposable, CompilerConfiguration(), EnvironmentConfigFiles.JS_CONFIG_FILES)
|
||||||
}
|
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
val METADATA_CACHE = (JsConfig.JS_STDLIB.asSequence() + JsConfig.JS_KOTLIN_TEST)
|
val METADATA_CACHE = (JsConfig.JS_STDLIB.asSequence() + JsConfig.JS_KOTLIN_TEST)
|
||||||
|
|||||||
Reference in New Issue
Block a user