Cleanup test utilities in JvmResolveUtil and GenerationUtils
Simplify usages and fix some warnings along the way. Rename: - analyzeFilesWithJavaIntegration, analyzeOneFileWithJavaIntegration -> analyze - analyzeFilesWithJavaIntegrationAndCheckForErrors, analyzeOneFileWithJavaIntegrationAndCheckForErrors -> analyzeAndCheckForErrors - compileFilesGetGenerationState, compileManyFilesGetGenerationStateForTest -> compileFiles - compileFileGetGenerationStateForTest -> compileFile - compileFileGetClassFileFactoryForTest -> compileFileTo
This commit is contained in:
+1
-1
@@ -51,7 +51,7 @@ class CapturedTypeApproximationTest : KotlinTestWithEnvironment() {
|
||||
fun analyzeTestFile(testType: String) = run {
|
||||
val test = declarationsText.replace("#TestType#", testType)
|
||||
val testFile = KtPsiFactory(project).createFile(test)
|
||||
val bindingContext = JvmResolveUtil.analyzeOneFileWithJavaIntegration(testFile).bindingContext
|
||||
val bindingContext = JvmResolveUtil.analyze(testFile, environment).bindingContext
|
||||
val functions = bindingContext.getSliceContents(BindingContext.FUNCTION)
|
||||
val functionFoo = functions.values.firstOrNull { it.name.asString() == "foo" } ?:
|
||||
throw AssertionError("Function 'foo' is not declared")
|
||||
|
||||
Reference in New Issue
Block a user