Skip to content

Commit

Permalink
Correct fix: test the right instance.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmorgan committed Feb 11, 2025
1 parent 8613909 commit 27d7523
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions build_resolvers/test/resolver_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -728,8 +728,8 @@ int? get x => 1;
});

group('syntax errors', () {
test('are reported', () async {
await resolveSources({
test('are reported', () {
return resolveSources({
'a|errors.dart': '''
library a_library;
Expand All @@ -738,37 +738,37 @@ int? get x => 1;
}
''',
}, (resolver) async {
expect(
await expectLater(
resolver.libraryFor(AssetId.parse('a|errors.dart')),
throwsA(isA<SyntaxErrorInAssetException>()),
);
expect(
await expectLater(
resolver.compilationUnitFor(AssetId.parse('a|errors.dart')),
throwsA(isA<SyntaxErrorInAssetException>()),
);
});
}, resolvers: createResolvers());
});

test('are only reported if severe', () async {
await resolveSources({
test('are only reported if severe', () {
return resolveSources({
'a|errors.dart': '''
/// {@code }
class A{}
''',
}, (resolver) async {
expect(
await resolver.libraryFor(AssetId.parse('a|errors.dart')),
isNotNull,
await expectLater(
resolver.libraryFor(AssetId.parse('a|errors.dart')),
completion(isNotNull),
);
expect(
await resolver.compilationUnitFor(AssetId.parse('a|errors.dart')),
isNotNull,
await expectLater(
resolver.compilationUnitFor(AssetId.parse('a|errors.dart')),
completion(isNotNull),
);
});
}, resolvers: createResolvers());
});

test('are reported for part files with errors', () async {
await resolveSources({
test('are reported for part files with errors', () {
return resolveSources({
'a|lib.dart': '''
library a_library;
part 'errors.dart';
Expand Down

0 comments on commit 27d7523

Please sign in to comment.