Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(375)

Unified Diff: pkg/analyzer/test/src/context/abstract_context.dart

Issue 1320273003: Clean up and improve some of the task tests (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analyzer/test/src/task/dart_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/context/abstract_context.dart
diff --git a/pkg/analyzer/test/src/context/abstract_context.dart b/pkg/analyzer/test/src/context/abstract_context.dart
index 87f3b21b770b5948b1e0fb6bd21c8d4ccf4f3805..09c30b28de587d8e1b21e48974a608a5dab0c444 100644
--- a/pkg/analyzer/test/src/context/abstract_context.dart
+++ b/pkg/analyzer/test/src/context/abstract_context.dart
@@ -72,12 +72,20 @@ class AbstractContextTest {
/**
* Compute the given [result] for the given [target].
*/
- void computeResult(AnalysisTarget target, ResultDescriptor result) {
+ void computeResult(AnalysisTarget target, ResultDescriptor result,
+ {isInstanceOf matcher: null}) {
oldOutputs = outputs;
task = analysisDriver.computeResult(target, result);
- expect(task, isNotNull);
+ if (matcher == null) {
+ expect(task, isNotNull);
+ } else {
+ expect(task, matcher);
+ }
expect(task.caughtException, isNull);
outputs = task.outputs;
+ for (ResultDescriptor descriptor in task.descriptor.results) {
+ expect(outputs, contains(descriptor));
+ }
}
AnalysisContextImpl createAnalysisContext() {
« no previous file with comments | « no previous file | pkg/analyzer/test/src/task/dart_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698