| Index: pkg/analyzer/test/src/summary/resynthesize_test.dart
|
| diff --git a/pkg/analyzer/test/src/summary/resynthesize_test.dart b/pkg/analyzer/test/src/summary/resynthesize_test.dart
|
| index 93d1bcedf74d7ffb1c22b87f9599cbc4670fd3a0..cb9b2d594612b91d97e0837e5e4aeb0a1ef5dd3a 100644
|
| --- a/pkg/analyzer/test/src/summary/resynthesize_test.dart
|
| +++ b/pkg/analyzer/test/src/summary/resynthesize_test.dart
|
| @@ -577,6 +577,15 @@ class ResynthTest extends ResolverTestCase {
|
| }
|
| }
|
| if (original is! Member) {
|
| + List<LabelElement> rLabels = resynthesized.labels;
|
| + List<LabelElement> oLabels = original.labels;
|
| + expect(rLabels, hasLength(oLabels.length));
|
| + for (int i = 0; i < oLabels.length; i++) {
|
| + compareLabelElements(
|
| + rLabels[i], oLabels[i], '$desc label ${oLabels[i].name}');
|
| + }
|
| + }
|
| + if (original is! Member) {
|
| List<LocalVariableElement> rVariables = resynthesized.localVariables;
|
| List<LocalVariableElement> oVariables = original.localVariables;
|
| expect(rVariables, hasLength(oVariables.length));
|
| @@ -654,6 +663,15 @@ class ResynthTest extends ResolverTestCase {
|
| }
|
| }
|
|
|
| + void compareLabelElements(
|
| + LabelElementImpl resynthesized, LabelElementImpl original, String desc) {
|
| + expect(resynthesized.isOnSwitchMember, original.isOnSwitchMember,
|
| + reason: desc);
|
| + expect(resynthesized.isOnSwitchStatement, original.isOnSwitchStatement,
|
| + reason: desc);
|
| + compareElements(resynthesized, original, desc);
|
| + }
|
| +
|
| void compareMetadata(List<ElementAnnotation> resynthesized,
|
| List<ElementAnnotation> original, String desc) {
|
| expect(resynthesized, hasLength(original.length), reason: desc);
|
| @@ -2879,6 +2897,46 @@ get g {
|
| ''');
|
| }
|
|
|
| + test_localLabels_inConstructor() {
|
| + checkLibrary(r'''
|
| +class C {
|
| + C() {
|
| + aaa: while (true) {}
|
| + bbb: switch (42) {
|
| + ccc: case 0:
|
| + break;
|
| + }
|
| + }
|
| +}
|
| +''');
|
| + }
|
| +
|
| + test_localLabels_inMethod() {
|
| + checkLibrary(r'''
|
| +class C {
|
| + m() {
|
| + aaa: while (true) {}
|
| + bbb: switch (42) {
|
| + ccc: case 0:
|
| + break;
|
| + }
|
| + }
|
| +}
|
| +''');
|
| + }
|
| +
|
| + test_localLabels_inTopLevelFunction() {
|
| + checkLibrary(r'''
|
| +main() {
|
| + aaa: while (true) {}
|
| + bbb: switch (42) {
|
| + ccc: case 0:
|
| + break;
|
| + }
|
| +}
|
| +''');
|
| + }
|
| +
|
| test_localVariables_inConstructor() {
|
| checkLibrary(r'''
|
| class C {
|
|
|