Fix warnings in stdlib/compiler/plugins/test code
This commit is contained in:
+3
-3
@@ -34,9 +34,9 @@ abstract class AbstractAndroidBytecodeShapeTest : AbstractBytecodeTextTest() {
|
||||
addAndroidExtensionsRuntimeLibrary(myEnvironment)
|
||||
}
|
||||
|
||||
override fun doTest(path: String) {
|
||||
val fileName = path + getTestName(true) + ".kt"
|
||||
createAndroidAPIEnvironment(path)
|
||||
override fun doTest(filePath: String) {
|
||||
val fileName = filePath + getTestName(true) + ".kt"
|
||||
createAndroidAPIEnvironment(filePath)
|
||||
loadFileByFullPath(fileName)
|
||||
val expected = readExpectedOccurrences(fileName)
|
||||
val actual = generateToText()
|
||||
|
||||
+4
-2
@@ -8,7 +8,8 @@ package org.jetbrains.kotlin.importsDumper
|
||||
import com.intellij.openapi.util.io.FileUtil
|
||||
import com.intellij.testFramework.TestDataPath
|
||||
import junit.framework.TestCase
|
||||
import org.jetbrains.kotlin.cli.AbstractCliTest.*
|
||||
import org.jetbrains.kotlin.cli.AbstractCliTest.executeCompilerGrabOutput
|
||||
import org.jetbrains.kotlin.cli.AbstractCliTest.getNormalizedCompilerOutput
|
||||
import org.jetbrains.kotlin.cli.jvm.K2JVMCompiler
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils
|
||||
import org.jetbrains.kotlin.test.TestCaseWithTmpdir
|
||||
@@ -58,7 +59,8 @@ class ImportsDumperTest : TestCaseWithTmpdir() {
|
||||
tmpDir.path,
|
||||
"-Xplugin=${importsDumperJarInDist.path}",
|
||||
"-P",
|
||||
"plugin:${ImportsDumperCommandLineProcessor.PLUGIN_ID}:${ImportsDumperCliOptions.DESTINATION.name}=${actualDumpFile.path}"
|
||||
"plugin:${ImportsDumperCommandLineProcessor.PLUGIN_ID}:" +
|
||||
"${ImportsDumperCliOptions.DESTINATION.optionName}=${actualDumpFile.path}"
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
+1
-1
@@ -65,7 +65,7 @@ class KotlinKapt3IntegrationTests : AbstractKotlinKapt3IntegrationTest(), Custom
|
||||
|
||||
@Test
|
||||
fun testParameterNames() {
|
||||
test("DefaultParameterValues", "test.Anno") { set, roundEnv, env ->
|
||||
test("DefaultParameterValues", "test.Anno") { set, roundEnv, _ ->
|
||||
val user = roundEnv.getElementsAnnotatedWith(set.single()).single() as TypeElement
|
||||
val nameField = user.enclosedElements.filterIsInstance<VariableElement>().single()
|
||||
assertEquals("John", nameField.constantValue)
|
||||
|
||||
+4
-2
@@ -14,5 +14,7 @@ private const val BUNDLE = "messages.KotlinParcelizeBundle"
|
||||
|
||||
object KotlinParcelizeBundle : AbstractKotlinBundle(BUNDLE) {
|
||||
@JvmStatic
|
||||
fun message(@NonNls @PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any): String = getMessage(key, *params)
|
||||
}
|
||||
fun message(@NonNls @PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any): String =
|
||||
@Suppress("NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS")
|
||||
getMessage(key, *params)
|
||||
}
|
||||
|
||||
+5
-2
@@ -28,7 +28,10 @@ import org.jetbrains.kotlin.scripting.resolve.KtFileScriptSource
|
||||
import org.junit.Assert
|
||||
import java.io.File
|
||||
import kotlin.script.experimental.annotations.KotlinScript
|
||||
import kotlin.script.experimental.api.*
|
||||
import kotlin.script.experimental.api.ResultWithDiagnostics
|
||||
import kotlin.script.experimental.api.ScriptCompilationConfiguration
|
||||
import kotlin.script.experimental.api.compilerOptions
|
||||
import kotlin.script.experimental.api.fileExtension
|
||||
import kotlin.script.experimental.host.toScriptSource
|
||||
import kotlin.script.experimental.jvm.defaultJvmScriptingHostConfiguration
|
||||
import kotlin.script.experimental.jvmhost.createJvmScriptDefinitionFromTemplate
|
||||
@@ -52,7 +55,7 @@ abstract class AbstractSamWithReceiverScriptNewDefTest : AbstractDiagnosticsTest
|
||||
override fun analyzeAndCheck(testDataFile: File, files: List<TestFile>) {
|
||||
val definition = createJvmScriptDefinitionFromTemplate<ScriptForSamWithReceiversNewDef>()
|
||||
val scriptCompiler = ScriptJvmCompilerFromEnvironment(environment)
|
||||
val (scripts, regular) = files.partition {
|
||||
val scripts = files.filter {
|
||||
it.ktFile?.virtualFile?.extension == definition.compilationConfiguration[ScriptCompilationConfiguration.fileExtension]
|
||||
}
|
||||
super.analyzeAndCheck(testDataFile, files)
|
||||
|
||||
+1
-1
@@ -327,7 +327,7 @@ class JvmIdeServicesTest : TestCase() {
|
||||
private data class CliCompilationResult(val exitCode: ExitCode, val outputJarPath: String)
|
||||
|
||||
private fun compileFile(inputKtFileName: String, outputJarName: String): CliCompilationResult {
|
||||
val jarPath = outputJarDir.resolve(outputJarName).toAbsolutePath().invariantSeparatorsPath
|
||||
val jarPath = outputJarDir.resolve(outputJarName).toAbsolutePath().invariantSeparatorsPathString
|
||||
|
||||
val compilerArgs = arrayOf(
|
||||
"$MODULE_PATH/testData/$inputKtFileName",
|
||||
|
||||
Reference in New Issue
Block a user