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

Unified Diff: pkg/analyzer/test/src/task/model_test.dart

Issue 1633823002: Add support for tasks to determine whether they are appropriate for a given target (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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
« pkg/analyzer/lib/task/model.dart ('K') | « pkg/analyzer/lib/task/model.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/task/model_test.dart
diff --git a/pkg/analyzer/test/src/task/model_test.dart b/pkg/analyzer/test/src/task/model_test.dart
index 4db1ee2fef5aed8c5e2f5a10f770d5b042325522..0ea406e752d8047f5ba26738b9b2a9c83e39b90d 100644
--- a/pkg/analyzer/test/src/task/model_test.dart
+++ b/pkg/analyzer/test/src/task/model_test.dart
@@ -103,7 +103,7 @@ class SimpleResultCachingPolicyTest extends EngineTestCase {
@reflectiveTest
class TaskDescriptorImplTest extends EngineTestCase {
- test_create() {
+ test_create_noOptionalArgs() {
String name = 'name';
BuildTask buildTask = (context, target) {};
CreateTaskInputs createTaskInputs = (target) {};
@@ -114,12 +114,30 @@ class TaskDescriptorImplTest extends EngineTestCase {
expect(descriptor.name, name);
expect(descriptor.buildTask, equals(buildTask));
expect(descriptor.createTaskInputs, equals(createTaskInputs));
+ expect(descriptor.isAppropriateFor(null), isTrue);
+ expect(descriptor.results, results);
+ }
+
+ test_create_withIsAppropriateFor() {
+ String name = 'name';
+ BuildTask buildTask = (context, target) {};
+ CreateTaskInputs createTaskInputs = (target) {};
+ List<ResultDescriptor> results = <ResultDescriptor>[];
+ IsAppropriateFor isAppropriateFor = (target) => false;
+ TaskDescriptorImpl descriptor = new TaskDescriptorImpl(
+ name, buildTask, createTaskInputs, results,
+ isAppropriateFor: isAppropriateFor);
+ expect(descriptor, isNotNull);
+ expect(descriptor.name, name);
+ expect(descriptor.buildTask, equals(buildTask));
+ expect(descriptor.createTaskInputs, equals(createTaskInputs));
+ expect(descriptor.isAppropriateFor(null), isFalse);
expect(descriptor.results, results);
}
test_createTask() {
- BuildTask buildTask = (context, target) =>
- new TestAnalysisTask(context, target);
+ BuildTask buildTask =
+ (context, target) => new TestAnalysisTask(context, target);
CreateTaskInputs createTaskInputs = (target) {};
List<ResultDescriptor> results = <ResultDescriptor>[];
TaskDescriptorImpl descriptor =
« pkg/analyzer/lib/task/model.dart ('K') | « pkg/analyzer/lib/task/model.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698