@@ -195,6 +195,9 @@ class PubPackageResolutionTest with MockPackagesMixin, ResourceProviderMixin {
195195 /// descriptions and locations.
196196 ///
197197 /// The order in which the diagnostics were gathered is ignored.
198+ ///
199+ /// Note: Be sure to `await` any use of this API, to avoid stale analysis
200+ /// results (See [DisposedAnalysisContextResult] ).
198201 Future <void > assertDiagnostics (
199202 String content,
200203 List <ExpectedDiagnostic > expectedDiagnostics,
@@ -205,6 +208,9 @@ class PubPackageResolutionTest with MockPackagesMixin, ResourceProviderMixin {
205208 }
206209
207210 /// Asserts that the diagnostics in [diagnostics] match [expectedDiagnostics] .
211+ ///
212+ /// Note: Be sure to `await` any use of this API, to avoid stale analysis
213+ /// results (See [DisposedAnalysisContextResult] ).
208214 void assertDiagnosticsIn (
209215 List <Diagnostic > diagnostics,
210216 List <ExpectedDiagnostic > expectedDiagnostics,
@@ -269,6 +275,9 @@ class PubPackageResolutionTest with MockPackagesMixin, ResourceProviderMixin {
269275 /// expected error descriptions and locations.
270276 ///
271277 /// The order in which the diagnostics were gathered is ignored.
278+ ///
279+ /// Note: Be sure to `await` any use of this API, to avoid stale analysis
280+ /// results (See [DisposedAnalysisContextResult] ).
272281 Future <void > assertDiagnosticsInFile (
273282 String path,
274283 List <ExpectedDiagnostic > expectedDiagnostics,
@@ -282,6 +291,9 @@ class PubPackageResolutionTest with MockPackagesMixin, ResourceProviderMixin {
282291 ///
283292 /// The unit at each path needs to have already been written to the file
284293 /// system before calling this method.
294+ ///
295+ /// Note: Be sure to `await` any use of this API, to avoid stale analysis
296+ /// results (See [DisposedAnalysisContextResult] ).
285297 Future <void > assertDiagnosticsInUnits (
286298 List <(String path, List <ExpectedDiagnostic > expectedDiagnostics)>
287299 unitsAndDiagnostics,
@@ -293,10 +305,16 @@ class PubPackageResolutionTest with MockPackagesMixin, ResourceProviderMixin {
293305 }
294306
295307 /// Asserts that there are no diagnostics in the given [content] .
308+ ///
309+ /// Note: Be sure to `await` any use of this API, to avoid stale analysis
310+ /// results (See [DisposedAnalysisContextResult] ).
296311 Future <void > assertNoDiagnostics (String content) async =>
297312 assertDiagnostics (content, const []);
298313
299314 /// Asserts that there are no diagnostics in the file at the given [path] .
315+ ///
316+ /// Note: Be sure to `await` any use of this API, to avoid stale analysis
317+ /// results (See [DisposedAnalysisContextResult] ).
300318 Future <void > assertNoDiagnosticsInFile (String path) async =>
301319 assertDiagnosticsInFile (path, const []);
302320
0 commit comments