| Index: compiler/javatests/com/google/dart/compiler/resolver/ResolverTest.java
|
| diff --git a/compiler/javatests/com/google/dart/compiler/resolver/ResolverTest.java b/compiler/javatests/com/google/dart/compiler/resolver/ResolverTest.java
|
| index faa57aec7b3b40ee5087fed4ca904897856b1e47..1fc2ae102f8a3b4adffd58c2b66ac06d0c65416c 100644
|
| --- a/compiler/javatests/com/google/dart/compiler/resolver/ResolverTest.java
|
| +++ b/compiler/javatests/com/google/dart/compiler/resolver/ResolverTest.java
|
| @@ -972,6 +972,54 @@ public class ResolverTest extends ResolverTestCase {
|
| ErrorExpectation.errEx(ResolverErrorCode.DUPLICATE_LABEL_IN_SWITCH_STATEMENT, 5, 3, 2));
|
| }
|
|
|
| + public void test_breakInSwitch() {
|
| + resolveAndTest(Joiner.on("\n").join(
|
| + "class Object {}",
|
| + "foo() {",
|
| + " switch(1) {",
|
| + " a: case 0:",
|
| + " break a;",
|
| + " }",
|
| + "}"),
|
| + ErrorExpectation.errEx(ResolverErrorCode.BREAK_LABEL_RESOLVES_TO_CASE_OR_DEFAULT, 5, 14, 1));
|
| + }
|
| +
|
| + public void test_continueInSwitch1() {
|
| + resolveAndTest(Joiner.on("\n").join(
|
| + "class Object {}",
|
| + "foo() {",
|
| + " switch(1) {",
|
| + " a: case 0:",
|
| + " continue a;",
|
| + " }",
|
| + "}"));
|
| + }
|
| +
|
| + public void test_continueInSwitch2() {
|
| + resolveAndTest(Joiner.on("\n").join(
|
| + "class Object {}",
|
| + "foo() {",
|
| + " switch(1) {",
|
| + " case 0:",
|
| + " continue a;",
|
| + " a: case 1:",
|
| + " break;",
|
| + " }",
|
| + "}"));
|
| + }
|
| +
|
| + public void test_continueInSwitch3() {
|
| + resolveAndTest(Joiner.on("\n").join(
|
| + "class Object {}",
|
| + "foo() {",
|
| + " a: switch(1) {",
|
| + " case 0:",
|
| + " continue a;",
|
| + " }",
|
| + "}"),
|
| + ErrorExpectation.errEx(ResolverErrorCode.CONTINUE_LABEL_RESOLVES_TO_SWITCH, 5, 17, 1));
|
| + }
|
| +
|
| public void test_new_noSuchType() throws Exception {
|
| resolveAndTest(Joiner.on("\n").join(
|
| "class Object {}",
|
|
|