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

Side by Side Diff: pkg/analyzer/test/src/task/model_test.dart

Issue 2391423003: Switch 'analyzer' to 'package:test' and test_reflective_loader ^0.1.0. (Closed)
Patch Set: Created 4 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library analyzer.test.src.task.model_test; 5 library analyzer.test.src.task.model_test;
6 6
7 import 'package:analyzer/exception/exception.dart';
7 import 'package:analyzer/src/generated/engine.dart'; 8 import 'package:analyzer/src/generated/engine.dart';
8 import 'package:analyzer/exception/exception.dart';
9 import 'package:analyzer/src/task/model.dart'; 9 import 'package:analyzer/src/task/model.dart';
10 import 'package:analyzer/task/model.dart'; 10 import 'package:analyzer/task/model.dart';
11 import 'package:test/test.dart';
11 import 'package:test_reflective_loader/test_reflective_loader.dart'; 12 import 'package:test_reflective_loader/test_reflective_loader.dart';
12 import 'package:unittest/unittest.dart';
13 13
14 import '../../generated/test_support.dart'; 14 import '../../generated/test_support.dart';
15 import '../../utils.dart'; 15 import '../../utils.dart';
16 import 'test_support.dart'; 16 import 'test_support.dart';
17 17
18 main() { 18 main() {
19 initializeTestEnvironment(); 19 initializeTestEnvironment();
20 defineReflectiveTests(AnalysisTaskTest); 20 defineReflectiveSuite(() {
21 defineReflectiveTests(ResultDescriptorImplTest); 21 defineReflectiveTests(AnalysisTaskTest);
22 defineReflectiveTests(SimpleResultCachingPolicyTest); 22 defineReflectiveTests(ResultDescriptorImplTest);
23 defineReflectiveTests(TaskDescriptorImplTest); 23 defineReflectiveTests(SimpleResultCachingPolicyTest);
24 defineReflectiveTests(TaskDescriptorImplTest);
25 });
24 } 26 }
25 27
26 @reflectiveTest 28 @reflectiveTest
27 class AnalysisTaskTest extends EngineTestCase { 29 class AnalysisTaskTest extends EngineTestCase {
28 test_getRequiredInput_missingKey() { 30 test_getRequiredInput_missingKey() {
29 AnalysisTarget target = new TestSource(); 31 AnalysisTarget target = new TestSource();
30 AnalysisTask task = new TestAnalysisTask(null, target); 32 AnalysisTask task = new TestAnalysisTask(null, target);
31 task.inputs = {'a': 'b'}; 33 task.inputs = {'a': 'b'};
32 expect(() => task.getRequiredInput('c'), 34 expect(() => task.getRequiredInput('c'),
33 throwsA(new isInstanceOf<AnalysisException>())); 35 throwsA(new isInstanceOf<AnalysisException>()));
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 AnalysisContext context = null; 147 AnalysisContext context = null;
146 AnalysisTarget target = new TestSource(); 148 AnalysisTarget target = new TestSource();
147 Map<String, dynamic> inputs = {}; 149 Map<String, dynamic> inputs = {};
148 AnalysisTask createTask = descriptor.createTask(context, target, inputs); 150 AnalysisTask createTask = descriptor.createTask(context, target, inputs);
149 expect(createTask, isNotNull); 151 expect(createTask, isNotNull);
150 expect(createTask.context, context); 152 expect(createTask.context, context);
151 expect(createTask.inputs, inputs); 153 expect(createTask.inputs, inputs);
152 expect(createTask.target, target); 154 expect(createTask.target, target);
153 } 155 }
154 } 156 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698