Skip to content

Commit

Permalink
fix resolver tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jakemac53 committed Oct 8, 2024
1 parent d142fd8 commit ccfb8f8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions build_resolvers/lib/src/resolver.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,10 @@ class PerActionResolver implements ReleasableResolver {
// model manually.
yield current;
final toCrawl = current.definingCompilationUnit.libraryImports
.map((import) => import.library)
.map((import) => import.importedLibrary)
.followedBy(current.definingCompilationUnit.libraryExports
.map((export) => export.library))
.map((export) => export.exportedLibrary))
.nonNulls
.where((library) => !seen.contains(library))
.toSet();
toVisit.addAll(toCrawl);
Expand Down
6 changes: 3 additions & 3 deletions build_resolvers/test/resolver_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void main() {
var libA = lib
..definingCompilationUnit
.libraryImports
.where((l) => l.library.name == 'a')
.where((l) => l.importedLibrary!.name == 'a')
.single;
expect(libA.getClass('Foo'), isNull);
}, resolvers: AnalyzerResolvers());
Expand All @@ -72,7 +72,7 @@ void main() {
var libB = lib
..definingCompilationUnit
.libraryImports
.where((l) => l.library.name == 'b')
.where((l) => l.importedLibrary!.name == 'b')
.single;
expect(libB.getClass('Foo'), isNull);
}, resolvers: AnalyzerResolvers());
Expand Down Expand Up @@ -466,7 +466,7 @@ void main() {
}, (resolver) async {
var entry = await resolver.libraryFor(AssetId('a', 'lib/a.dart'));
var classDefinition = entry.definingCompilationUnit.libraryImports
.map((l) => l.library.getClass('SomeClass'))
.map((l) => l.importedLibrary!.getClass('SomeClass'))
.singleWhere((c) => c != null)!;
expect(await resolver.assetIdForElement(classDefinition),
AssetId('a', 'lib/b.dart'));
Expand Down

0 comments on commit ccfb8f8

Please sign in to comment.