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

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

Issue 1034783002: Tests for ListTaskInputImpl. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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 | 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/inputs_test.dart
diff --git a/pkg/analyzer/test/src/task/inputs_test.dart b/pkg/analyzer/test/src/task/inputs_test.dart
index 758f0a05d8f32c1351b7a6dd9d6ae6ce918ec3e5..f894d11aee361877c84e842d1db9de81569c89c6 100644
--- a/pkg/analyzer/test/src/task/inputs_test.dart
+++ b/pkg/analyzer/test/src/task/inputs_test.dart
@@ -14,6 +14,7 @@ import '../../reflective_tests.dart';
main() {
groupSep = ' | ';
+ runReflectiveTests(ListTaskInputImplTest);
runReflectiveTests(ListToListTaskInputTest);
runReflectiveTests(ListToListTaskInputBuilderTest);
runReflectiveTests(ListToMapTaskInputBuilderTest);
@@ -24,6 +25,53 @@ main() {
}
@reflectiveTest
+class ListTaskInputImplTest extends EngineTestCase {
+ static final AnalysisTarget target = new TestSource();
+ static final result1 =
+ new ResultDescriptorImpl<List<AnalysisTarget>>('result1', null);
+ static final result2 = new ResultDescriptorImpl<int>('result2', null);
+
+ test_create() {
+ var input = new ListTaskInputImpl<AnalysisTarget>(target, result1);
+ expect(input, isNotNull);
+ expect(input.target, target);
+ expect(input.result, result1);
+ }
+
+ test_createBuilder() {
+ var input = new ListTaskInputImpl<AnalysisTarget>(target, result1);
+ expect(input.createBuilder(), new isInstanceOf<SimpleTaskInputBuilder>());
+ }
+
+ test_toList() {
+ var input = new ListTaskInputImpl<AnalysisTarget>(target, result1);
+ TaskInput<List> input2 = input.toList((target) => 'name');
+ expect(input2,
+ new isInstanceOf<ListToListTaskInput<AnalysisTarget, String>>());
+ }
+
+ test_toListOf() {
+ var input = new ListTaskInputImpl<AnalysisTarget>(target, result1);
+ TaskInput<List> input2 = input.toListOf(result2);
+ expect(
+ input2, new isInstanceOf<ListToListTaskInput<AnalysisTarget, int>>());
+ }
+
+ test_toMap() {
+ var input = new ListTaskInputImpl<AnalysisTarget>(target, result1);
+ TaskInput<Map> input2 = input.toMap((target) => 'name');
+ expect(
+ input2, new isInstanceOf<ListToMapTaskInput<AnalysisTarget, String>>());
+ }
+
+ test_toMapOf() {
+ var input = new ListTaskInputImpl<AnalysisTarget>(target, result1);
+ TaskInput<Map> input2 = input.toMapOf(result2);
+ expect(input2, new isInstanceOf<ListToMapTaskInput<AnalysisTarget, int>>());
+ }
+}
+
+@reflectiveTest
class ListToListTaskInputBuilderTest extends EngineTestCase {
static final AnalysisTarget target1 = new TestSource();
static final ResultDescriptorImpl result1 =
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698