FIR IDE: add failing multiModuleLazyResolve test
This commit is contained in:
+5
@@ -0,0 +1,5 @@
|
||||
package a;
|
||||
|
||||
public interface KtDeclaration extends KtElement {
|
||||
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
package a
|
||||
|
||||
interface KtElement : KtPureElement {
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package a
|
||||
|
||||
open class KtFile
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
package a;
|
||||
|
||||
public interface KtPureElement {
|
||||
KtFile getContainingKtFile();
|
||||
}
|
||||
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
FILE: main.kt
|
||||
public final val R|a/KtElement|.fqNameWithoutCompanions: R|a/KtFile|
|
||||
public get(): R|a/KtFile| {
|
||||
^ this@R|/fqNameWithoutCompanions|.R|a/KtPureElement.containingKtFile|
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
import a.*
|
||||
|
||||
val KtDeclaration.fqNameWithoutCompanions: KtFile
|
||||
get() = containingKtFile
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"modules" : [
|
||||
{ "name": "main", "dependsOn": ["dependency"] },
|
||||
{ "name": "dependency" }
|
||||
],
|
||||
"fileToResolve": { "module": "main", "file": "main.kt" },
|
||||
"fails": true
|
||||
}
|
||||
+2
-2
@@ -46,12 +46,12 @@ abstract class AbstractFirMultiModuleLazyResolveTest : AbstractMultiModuleTest()
|
||||
try {
|
||||
val fir = LowLevelFirApiFacade.getOrBuildFirFor(ktFileToAnalyse, resolveState, FirResolvePhase.BODY_RESOLVE)
|
||||
KotlinTestUtils.assertEqualsToFile(File("$path/expected.txt"), fir.render())
|
||||
} catch (e: Exception) {
|
||||
} catch (e: Throwable) {
|
||||
if (!fails) throw e
|
||||
return
|
||||
}
|
||||
if (fails) {
|
||||
throw AssertionError("Looks like test is passing, please remove // FAILS form the file")
|
||||
throw AssertionError("Looks like test is passing, please remove `\"fails\": true` from structure.json")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -28,6 +28,11 @@ public class FirMultiModuleLazyResolveTestGenerated extends AbstractFirMultiModu
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/multiModuleLazyResolve"), Pattern.compile("^([^\\.]+)$"), null, false);
|
||||
}
|
||||
|
||||
@TestMetadata("javaExtendsKotlinExtendsJava")
|
||||
public void testJavaExtendsKotlinExtendsJava() throws Exception {
|
||||
runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/multiModuleLazyResolve/javaExtendsKotlinExtendsJava/");
|
||||
}
|
||||
|
||||
@TestMetadata("whenWithHeiarchy")
|
||||
public void testWhenWithHeiarchy() throws Exception {
|
||||
runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/multiModuleLazyResolve/whenWithHeiarchy/");
|
||||
|
||||
Reference in New Issue
Block a user