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

Unified Diff: pkg/analyzer/test/src/dart/analysis/file_state_test.dart

Issue 2541793005: Return only public top-level declarations. (Closed)
Patch Set: after commit Created 4 years 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/lib/src/dart/analysis/file_state.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/dart/analysis/file_state_test.dart
diff --git a/pkg/analyzer/test/src/dart/analysis/file_state_test.dart b/pkg/analyzer/test/src/dart/analysis/file_state_test.dart
index f9433fec822b5858ee72e56538bbbb6a717fa21e..b4cafb27b282a33b50e1818bdd1f39c228bdff9f 100644
--- a/pkg/analyzer/test/src/dart/analysis/file_state_test.dart
+++ b/pkg/analyzer/test/src/dart/analysis/file_state_test.dart
@@ -295,19 +295,27 @@ get V2 => null;
set V3(_) {}
get V4 => null;
set V4(_) {}
+
+class _C {}
+typedef _F();
+enum _E {E1, E2}
+void _f() {}
+var _V1;
+get _V2 => null;
+set _V3(_) {}
''');
FileState file = fileSystemState.getFileForPath(path);
- List<TopLevelDeclaration> topLevelDeclarations = file.topLevelDeclarations;
+ List<TopLevelDeclaration> declarations = file.topLevelDeclarations;
void assertHas(String name, TopLevelDeclarationKind kind) {
expect(
- topLevelDeclarations,
+ declarations,
contains(predicate(
(TopLevelDeclaration t) => t.name == name && t.kind == kind)));
}
- expect(topLevelDeclarations.map((t) => t.name),
+ expect(declarations.map((t) => t.name),
unorderedEquals(['C', 'F', 'E', 'f', 'V1', 'V2', 'V3', 'V4']));
assertHas('C', TopLevelDeclarationKind.type);
assertHas('F', TopLevelDeclarationKind.type);
« no previous file with comments | « pkg/analyzer/lib/src/dart/analysis/file_state.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698