Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(34)

Unified Diff: pkg/analyzer/test/src/summary/resynthesize_test.dart

Issue 1940003002: Skip all local elements when comparing after AST based resynth. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/test/src/summary/resynthesize_ast_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 23dbd71c188ac4b4bd251b2082cb4351b6b5ecb5..f28654a1395c54b4f84418669b89861c3b4d5ea3 100644
--- a/pkg/analyzer/test/src/summary/resynthesize_test.dart
+++ b/pkg/analyzer/test/src/summary/resynthesize_test.dart
@@ -702,27 +702,7 @@ abstract class AbstractResynthesizeTest extends AbstractSingleUnitTest {
original.typeParameters[i],
'$desc type parameter ${original.typeParameters[i].name}');
}
- if (original is! Member) {
- List<FunctionElement> rFunctions = resynthesized.functions;
- List<FunctionElement> oFunctions = original.functions;
- expect(rFunctions, hasLength(oFunctions.length));
- for (int i = 0; i < oFunctions.length; i++) {
- compareFunctionElements(rFunctions[i], oFunctions[i],
- '$desc local function ${oFunctions[i].name}');
- }
- }
- 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) {
- compareLocalVariableElementLists(resynthesized, original, desc);
- }
+ compareLocalElementsOfExecutable(resynthesized, original, desc);
}
void compareExportElements(ExportElementImpl resynthesized,
@@ -800,14 +780,34 @@ abstract class AbstractResynthesizeTest extends AbstractSingleUnitTest {
compareElements(resynthesized, original, desc);
}
- void compareLocalVariableElementLists(ExecutableElement resynthesized,
+ void compareLocalElementsOfExecutable(ExecutableElement resynthesized,
ExecutableElement original, String desc) {
- List<LocalVariableElement> rVariables = resynthesized.localVariables;
- List<LocalVariableElement> oVariables = original.localVariables;
- expect(rVariables, hasLength(oVariables.length));
- for (int i = 0; i < oVariables.length; i++) {
- compareVariableElements(rVariables[i], oVariables[i],
- '$desc local variable ${oVariables[i].name}');
+ if (original is! Member) {
+ List<FunctionElement> rFunctions = resynthesized.functions;
+ List<FunctionElement> oFunctions = original.functions;
+ expect(rFunctions, hasLength(oFunctions.length));
+ for (int i = 0; i < oFunctions.length; i++) {
+ compareFunctionElements(rFunctions[i], oFunctions[i],
+ '$desc local function ${oFunctions[i].name}');
+ }
+ }
+ 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));
+ for (int i = 0; i < oVariables.length; i++) {
+ compareVariableElements(rVariables[i], oVariables[i],
+ '$desc local variable ${oVariables[i].name}');
+ }
}
}
« no previous file with comments | « pkg/analyzer/test/src/summary/resynthesize_ast_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698