@@ -95077,6 +95077,66 @@ final y = 0;
9507795077''');
9507895078 }
9507995079
95080+ test_operation_addFile_later_addPart() async {
95081+ configuration.withCheckLibraryDiagnosticsRequirements = true;
95082+
95083+ var driver = driverFor(testFile);
95084+ var collector = DriverEventCollector(driver, idProvider: idProvider);
95085+
95086+ var b = newFile('$testPackageLibPath/b.dart', r'''
95087+ part 'a.dart';
95088+ void f(A _) {}
95089+ ''');
95090+ driver.addFile2(b);
95091+
95092+ // No part `a.dart` yet.
95093+ // Has 2 errors: (1) no part; (2) no class `A`.
95094+ await assertEventsText(collector, r'''
95095+ [status] working
95096+ [operation] analyzeFile
95097+ file: /home/test/lib/b.dart
95098+ library: /home/test/lib/b.dart
95099+ [stream]
95100+ ResolvedUnitResult #0
95101+ path: /home/test/lib/b.dart
95102+ uri: package:test/b.dart
95103+ flags: exists isLibrary
95104+ errors
95105+ 5 +8 URI_DOES_NOT_EXIST
95106+ 22 +1 UNDEFINED_CLASS
95107+ [operation] analyzedLibrary
95108+ file: /home/test/lib/b.dart
95109+ [status] idle
95110+ ''');
95111+
95112+ var a = newFile('$testPackageLibPath/a.dart', r'''
95113+ part of 'b.dart';
95114+ class A {}
95115+ ''');
95116+ driver.addFile2(a);
95117+
95118+ // No errors: (1) the part is present; (2) class `A` in the part.
95119+ await assertEventsText(collector, r'''
95120+ [status] working
95121+ [operation] analyzeFile
95122+ file: /home/test/lib/a.dart
95123+ library: /home/test/lib/b.dart
95124+ [stream]
95125+ ResolvedUnitResult #1
95126+ path: /home/test/lib/b.dart
95127+ uri: package:test/b.dart
95128+ flags: exists isLibrary
95129+ [stream]
95130+ ResolvedUnitResult #2
95131+ path: /home/test/lib/a.dart
95132+ uri: package:test/a.dart
95133+ flags: exists isPart
95134+ [operation] analyzedLibrary
95135+ file: /home/test/lib/b.dart
95136+ [status] idle
95137+ ''');
95138+ }
95139+
9508095140 test_operation_getErrors_changeImported_affected() async {
9508195141 configuration.withCheckLibraryDiagnosticsRequirements = true;
9508295142
0 commit comments