Update DecompiledTextForWrongAbiVersionTest
This commit is contained in:
+1
-1
@@ -53,7 +53,7 @@ public class KotlinClsStubBuilder : ClsStubBuilder() {
|
||||
val classId = kotlinBinaryClass.getClassId()
|
||||
val packageFqName = classId.getPackageFqName()
|
||||
if (!header.isCompatibleAbiVersion) {
|
||||
return createIncompatibleAbiVersionFileStub(packageFqName)
|
||||
return createIncompatibleAbiVersionFileStub()
|
||||
}
|
||||
|
||||
val components = createStubBuilderComponents(file, packageFqName)
|
||||
|
||||
+1
-1
@@ -64,7 +64,7 @@ fun createPackageFacadeFileStub(
|
||||
return fileStub
|
||||
}
|
||||
|
||||
fun createIncompatibleAbiVersionFileStub(packageFqName: FqName) = createFileStub(packageFqName)
|
||||
fun createIncompatibleAbiVersionFileStub() = createFileStub(FqName.ROOT)
|
||||
|
||||
fun createFileStub(packageFqName: FqName): KotlinFileStubImpl {
|
||||
val fileStub = KotlinFileStubImpl(null, packageFqName.asString(), packageFqName.isRoot())
|
||||
|
||||
+3
-7
@@ -20,17 +20,15 @@ import com.intellij.testFramework.LightProjectDescriptor
|
||||
import org.jetbrains.jet.JetTestCaseBuilder
|
||||
import com.intellij.psi.PsiManager
|
||||
import org.junit.Assert
|
||||
import com.intellij.psi.PsiCompiledFile
|
||||
import org.jetbrains.jet.plugin.JetJdkAndLibraryProjectDescriptor
|
||||
import java.io.File
|
||||
import com.intellij.openapi.vfs.VirtualFile
|
||||
import com.intellij.psi.impl.compiled.ClsFileImpl
|
||||
import org.jetbrains.jet.plugin.decompiler.navigation.NavigateToDecompiledLibraryTest
|
||||
import org.jetbrains.jet.lang.psi.JetFile
|
||||
import org.jetbrains.jet.lang.resolve.java.JvmAnnotationNames.KotlinSyntheticClass.Kind.PACKAGE_PART
|
||||
import org.jetbrains.jet.lang.resolve.java.JvmAnnotationNames.KotlinSyntheticClass.Kind.ANONYMOUS_FUNCTION
|
||||
import org.jetbrains.jet.plugin.decompiler.AbstractInternalCompiledClassesTest
|
||||
import org.jetbrains.jet.plugin.decompiler.stubBuilder.findClassFileByName
|
||||
import org.jetbrains.jet.plugin.decompiler.JetClsFile
|
||||
|
||||
public class DecompiledTextForWrongAbiVersionTest : AbstractInternalCompiledClassesTest() {
|
||||
|
||||
@@ -55,10 +53,8 @@ public class DecompiledTextForWrongAbiVersionTest : AbstractInternalCompiledClas
|
||||
|
||||
private fun checkFileWithWrongAbiVersion(file: VirtualFile) {
|
||||
val psiFile = PsiManager.getInstance(getProject()!!).findFile(file)
|
||||
Assert.assertTrue(psiFile is ClsFileImpl)
|
||||
val decompiledPsiFile = (psiFile as PsiCompiledFile).getDecompiledPsiFile()
|
||||
Assert.assertTrue(decompiledPsiFile is JetFile)
|
||||
val decompiledText = decompiledPsiFile!!.getText()!!
|
||||
Assert.assertTrue(psiFile is JetClsFile)
|
||||
val decompiledText = psiFile!!.getText()!!
|
||||
Assert.assertTrue(decompiledText.contains(INCOMPATIBLE_ABI_VERSION_GENERAL_COMMENT))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user