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 34e20efdbb12f04d3580a5b54762526a16ef8807..fb37be9a44669fdb74c9a4c84c6c38f1c7220ac0 100644 |
--- a/pkg/analyzer/test/src/dart/analysis/driver_test.dart |
+++ b/pkg/analyzer/test/src/dart/analysis/driver_test.dart |
@@ -77,7 +77,7 @@ class DriverTest { |
}) |
], null, provider), |
new AnalysisOptionsImpl()..strongMode = true); |
- driver.status.lastWhere((status) { |
+ driver.status.listen((status) { |
allStatuses.add(status); |
if (status.isIdle) { |
idleStatusMonitor.notify(); |
@@ -141,6 +141,30 @@ var A = B; |
} |
} |
+ test_changeFile_noContentChange_noNewResult() async { |
+ _addTestFile('main() {}', priority: true); |
+ |
+ // Initial analysis. |
+ await _waitForIdle(); |
+ expect(allResults, hasLength(1)); |
+ |
+ // Update the file, but don't notify the driver. |
+ // Don't update the file in the file system. |
+ // But tell the driver the the file was changed. |
+ // The driver should eventually check the file and ignore. |
+ allStatuses.clear(); |
+ allResults.clear(); |
+ driver.changeFile(testFile); |
+ |
+ // The driver switched to analysis and back to idle. |
+ await _waitForIdle(); |
+ expect(allStatuses, hasLength(2)); |
+ expect(allStatuses.map((status) => status.isAnalyzing), [true, false]); |
+ |
+ // No new results. |
+ expect(allResults, isEmpty); |
+ } |
+ |
test_changeFile_selfConsistent() async { |
var a = _p('/test/lib/a.dart'); |
var b = _p('/test/lib/b.dart'); |