| Index: pkg/analyzer/test/src/dart/analysis/driver_test.dart
|
| diff --git a/pkg/analyzer/test/src/dart/analysis/driver_test.dart b/pkg/analyzer/test/src/dart/analysis/driver_test.dart
|
| index 04e2fe95f8f4a6821bdc38fd4e756397203b6439..f14a6ca9d2cacc24e656929ed9ee4ef7e2450a16 100644
|
| --- a/pkg/analyzer/test/src/dart/analysis/driver_test.dart
|
| +++ b/pkg/analyzer/test/src/dart/analysis/driver_test.dart
|
| @@ -362,6 +362,9 @@ var A = B;
|
| provider.updateFile(b, 'var B = 1.2;');
|
| driver.changeFile(b);
|
|
|
| + // "b" is not an added file, so it is not scheduled for analysis.
|
| + expect(driver.test.filesToAnalyze, isEmpty);
|
| +
|
| // While "b" is not analyzed explicitly, it is analyzed implicitly.
|
| // The change causes "a" to be reanalyzed.
|
| await _waitForIdle();
|
| @@ -372,6 +375,28 @@ var A = B;
|
| }
|
| }
|
|
|
| + test_changeFile_notUsed() async {
|
| + var a = _p('/test/lib/a.dart');
|
| + var b = _p('/other/b.dart');
|
| + provider.newFile(a, '');
|
| + provider.newFile(b, 'class B1 {}');
|
| +
|
| + driver.addFile(a);
|
| +
|
| + await _waitForIdle();
|
| + allResults.clear();
|
| +
|
| + // Change "b" and notify.
|
| + // Nothing depends on "b", so nothing is analyzed.
|
| + provider.updateFile(b, 'class B2 {}');
|
| + driver.changeFile(b);
|
| + await _waitForIdle();
|
| + expect(allResults, isEmpty);
|
| +
|
| + // This should not add "b" to the file state.
|
| + expect(driver.fsState.knownFilePaths, isNot(contains(b)));
|
| + }
|
| +
|
| test_changeFile_selfConsistent() async {
|
| var a = _p('/test/lib/a.dart');
|
| var b = _p('/test/lib/b.dart');
|
| @@ -455,6 +480,9 @@ var A2 = B1;
|
| // Notify the driver about the change.
|
| driver.changeFile(testFile);
|
|
|
| + // The file was added, so it is scheduled for analysis.
|
| + expect(driver.test.filesToAnalyze, contains(testFile));
|
| +
|
| // We get a new result.
|
| {
|
| await _waitForIdle();
|
|
|