Add simple checker tests for scripts
This commit is contained in:
@@ -377,6 +377,7 @@ fun main(args: Array<String>) {
|
||||
model("checker/regression")
|
||||
model("checker/recovery")
|
||||
model("checker/rendering")
|
||||
model("checker/scripts", extension = "kts")
|
||||
model("checker/duplicateJvmSignature")
|
||||
model("checker/infos", testMethod = "doTestWithInfos")
|
||||
}
|
||||
|
||||
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
val c = true
|
||||
if (c) {
|
||||
2 + 3
|
||||
}
|
||||
|
||||
fun f() {
|
||||
if (!c) {
|
||||
3 + 4
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
package org.my
|
||||
|
||||
val x = 1
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
fun f() {
|
||||
}
|
||||
|
||||
fun g() {
|
||||
f()
|
||||
}
|
||||
|
||||
val c = 1
|
||||
|
||||
1 + 2
|
||||
|
||||
val k = f()
|
||||
|
||||
3 + 5
|
||||
|
||||
g()
|
||||
f()
|
||||
|
||||
class C {
|
||||
fun f() {
|
||||
}
|
||||
}
|
||||
|
||||
val cc = C()
|
||||
|
||||
cc.f()
|
||||
@@ -0,0 +1,2 @@
|
||||
val x = <error descr="[UNINITIALIZED_VARIABLE] Variable 'y' must be initialized">y</error>
|
||||
val y = 3
|
||||
@@ -563,6 +563,39 @@ public class PsiCheckerTestGenerated extends AbstractPsiCheckerTest {
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("idea/testData/checker/scripts")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Scripts extends AbstractPsiCheckerTest {
|
||||
public void testAllFilesPresentInScripts() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/checker/scripts"), Pattern.compile("^(.+)\\.kts$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("if.kts")
|
||||
public void testIf() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/checker/scripts/if.kts");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("packageStatement.kts")
|
||||
public void testPackageStatement() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/checker/scripts/packageStatement.kts");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("simple.kts")
|
||||
public void testSimple() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/checker/scripts/simple.kts");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("uninitializedVariable.kts")
|
||||
public void testUninitializedVariable() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/checker/scripts/uninitializedVariable.kts");
|
||||
doTest(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("idea/testData/checker/duplicateJvmSignature")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
|
||||
Reference in New Issue
Block a user