REPL: fix open parenthesis not triggering "incomplete"

Check if all of the syntax errors are at EOF, not that there's a single one.
In case of open parenthesis two syntax errors are reported for some reason
This commit is contained in:
Alexander Udalov
2014-07-27 17:34:41 -07:00
parent 4213ce318e
commit 6eb5567895
7 changed files with 54 additions and 21 deletions
@@ -31,7 +31,7 @@ import org.jetbrains.jet.repl.AbstractReplInterpreterTest;
/** This class is generated by {@link org.jetbrains.jet.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */
@SuppressWarnings("all")
@TestMetadata("compiler/testData/repl")
@InnerTestClasses({ReplInterpreterTestGenerated.Classes.class, ReplInterpreterTestGenerated.Objects.class, ReplInterpreterTestGenerated.Reflection.class})
@InnerTestClasses({ReplInterpreterTestGenerated.Classes.class, ReplInterpreterTestGenerated.Multiline.class, ReplInterpreterTestGenerated.Objects.class, ReplInterpreterTestGenerated.Reflection.class})
public class ReplInterpreterTestGenerated extends AbstractReplInterpreterTest {
public void testAllFilesPresentInRepl() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("compiler/testData/repl"), Pattern.compile("^(.+)\\.repl$"), true);
@@ -82,16 +82,6 @@ public class ReplInterpreterTestGenerated extends AbstractReplInterpreterTest {
doTest("compiler/testData/repl/imports.repl");
}
@TestMetadata("multiline.repl")
public void testMultiline() throws Exception {
doTest("compiler/testData/repl/multiline.repl");
}
@TestMetadata("multiline3.repl")
public void testMultiline3() throws Exception {
doTest("compiler/testData/repl/multiline3.repl");
}
@TestMetadata("simple.repl")
public void testSimple() throws Exception {
doTest("compiler/testData/repl/simple.repl");
@@ -160,6 +150,34 @@ public class ReplInterpreterTestGenerated extends AbstractReplInterpreterTest {
}
@TestMetadata("compiler/testData/repl/multiline")
public static class Multiline extends AbstractReplInterpreterTest {
public void testAllFilesPresentInMultiline() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("compiler/testData/repl/multiline"), Pattern.compile("^(.+)\\.repl$"), true);
}
@TestMetadata("functionOnSeveralLines.repl")
public void testFunctionOnSeveralLines() throws Exception {
doTest("compiler/testData/repl/multiline/functionOnSeveralLines.repl");
}
@TestMetadata("multilineFunctionInvocation.repl")
public void testMultilineFunctionInvocation() throws Exception {
doTest("compiler/testData/repl/multiline/multilineFunctionInvocation.repl");
}
@TestMetadata("openParenthesisIncomplete.repl")
public void testOpenParenthesisIncomplete() throws Exception {
doTest("compiler/testData/repl/multiline/openParenthesisIncomplete.repl");
}
@TestMetadata("simpleFunctionBodyOnNextLine.repl")
public void testSimpleFunctionBodyOnNextLine() throws Exception {
doTest("compiler/testData/repl/multiline/simpleFunctionBodyOnNextLine.repl");
}
}
@TestMetadata("compiler/testData/repl/objects")
public static class Objects extends AbstractReplInterpreterTest {
public void testAllFilesPresentInObjects() throws Exception {
@@ -195,6 +213,7 @@ public class ReplInterpreterTestGenerated extends AbstractReplInterpreterTest {
TestSuite suite = new TestSuite("ReplInterpreterTestGenerated");
suite.addTestSuite(ReplInterpreterTestGenerated.class);
suite.addTestSuite(Classes.class);
suite.addTestSuite(Multiline.class);
suite.addTestSuite(Objects.class);
suite.addTestSuite(Reflection.class);
return suite;