| Index: compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java
|
| diff --git a/compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java b/compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java
|
| index 5b4ab919fcf3fd88805102ca36d7190e31d05e6e..c18fd6503c7f3638f6c49d725016e818af24e60b 100644
|
| --- a/compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java
|
| +++ b/compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java
|
| @@ -40,6 +40,9 @@ import com.google.dart.compiler.ast.DartVariable;
|
| import com.google.dart.compiler.ast.DartVariableStatement;
|
| import com.google.dart.compiler.ast.NodeList;
|
|
|
| +import static com.google.dart.compiler.common.ErrorExpectation.assertErrors;
|
| +import static com.google.dart.compiler.common.ErrorExpectation.errEx;
|
| +
|
| import java.util.List;
|
|
|
| public class SyntaxTest extends AbstractParserTest {
|
| @@ -84,6 +87,28 @@ public class SyntaxTest extends AbstractParserTest {
|
| ParserErrorCode.EXPECTED_TOKEN, 3, 12);
|
| }
|
|
|
| + /**
|
| + * There was bug that handling missing identifier (method name) after "cursor." in switch caused
|
| + * infinite parsing loop.
|
| + * <p>
|
| + * http://code.google.com/p/dart/issues/detail?id=6908
|
| + */
|
| + public void test_switch_noMethodName_inCase() {
|
| + DartParserRunner runner = parseSource(Joiner.on("\n").join(
|
| + "// filler filler filler filler filler filler filler filler filler filler",
|
| + "void main() {",
|
| + " print((e) {",
|
| + " switch (e) {",
|
| + " case 'Up': cursor.();",
|
| + " case 'Down':",
|
| + " }",
|
| + " }); ",
|
| + "}",
|
| + ""));
|
| + assertErrors(runner.getErrors(),
|
| + errEx(ParserErrorCode.INVALID_IDENTIFIER, 5, 24, 1));
|
| + }
|
| +
|
| public void test_getter() {
|
| parseUnit("getter.dart", Joiner.on("\n").join(
|
| "class G {",
|
|
|