Skip to content

Commit 8613909

Browse files
committed
Fix order-dependent test: finish testing during the test.
1 parent 06221ad commit 8613909

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

build_resolvers/test/resolver_test.dart

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -728,8 +728,8 @@ int? get x => 1;
728728
});
729729

730730
group('syntax errors', () {
731-
test('are reported', () {
732-
return resolveSources({
731+
test('are reported', () async {
732+
await resolveSources({
733733
'a|errors.dart': '''
734734
library a_library;
735735
@@ -738,36 +738,37 @@ int? get x => 1;
738738
}
739739
''',
740740
}, (resolver) async {
741-
await expectLater(
741+
expect(
742742
resolver.libraryFor(AssetId.parse('a|errors.dart')),
743743
throwsA(isA<SyntaxErrorInAssetException>()),
744744
);
745-
await expectLater(
745+
expect(
746746
resolver.compilationUnitFor(AssetId.parse('a|errors.dart')),
747747
throwsA(isA<SyntaxErrorInAssetException>()),
748748
);
749749
});
750750
});
751-
test('are only reported if severe', () {
752-
return resolveSources({
751+
752+
test('are only reported if severe', () async {
753+
await resolveSources({
753754
'a|errors.dart': '''
754755
/// {@code }
755756
class A{}
756757
''',
757758
}, (resolver) async {
758-
await expectLater(
759-
resolver.libraryFor(AssetId.parse('a|errors.dart')),
760-
completion(isNotNull),
759+
expect(
760+
await resolver.libraryFor(AssetId.parse('a|errors.dart')),
761+
isNotNull,
761762
);
762-
await expectLater(
763-
resolver.compilationUnitFor(AssetId.parse('a|errors.dart')),
764-
completion(isNotNull),
763+
expect(
764+
await resolver.compilationUnitFor(AssetId.parse('a|errors.dart')),
765+
isNotNull,
765766
);
766767
});
767768
});
768769

769-
test('are reported for part files with errors', () {
770-
return resolveSources({
770+
test('are reported for part files with errors', () async {
771+
await resolveSources({
771772
'a|lib.dart': '''
772773
library a_library;
773774
part 'errors.dart';

0 commit comments

Comments
 (0)