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); |