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

Side by Side Diff: pkg/analysis_server/test/protocol_server_test.dart

Issue 2394683006: Switch analysis_server to use 'package:test'. (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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 test.computer.element; 5 library test.computer.element;
6 6
7 import 'dart:mirrors'; 7 import 'dart:mirrors';
8 8
9 import 'package:analysis_server/src/constants.dart'; 9 import 'package:analysis_server/src/constants.dart';
10 import 'package:analysis_server/src/protocol_server.dart'; 10 import 'package:analysis_server/src/protocol_server.dart';
11 import 'package:analysis_server/src/services/search/search_engine.dart'; 11 import 'package:analysis_server/src/services/search/search_engine.dart';
12 import 'package:analyzer/dart/ast/ast.dart' as engine; 12 import 'package:analyzer/dart/ast/ast.dart' as engine;
13 import 'package:analyzer/dart/element/element.dart' as engine; 13 import 'package:analyzer/dart/element/element.dart' as engine;
14 import 'package:analyzer/dart/element/type.dart' as engine; 14 import 'package:analyzer/dart/element/type.dart' as engine;
15 import 'package:analyzer/error/error.dart' as engine; 15 import 'package:analyzer/error/error.dart' as engine;
16 import 'package:analyzer/src/error/codes.dart' as engine; 16 import 'package:analyzer/src/error/codes.dart' as engine;
17 import 'package:analyzer/src/generated/source.dart' as engine; 17 import 'package:analyzer/src/generated/source.dart' as engine;
18 import 'package:test/test.dart';
18 import 'package:test_reflective_loader/test_reflective_loader.dart'; 19 import 'package:test_reflective_loader/test_reflective_loader.dart';
19 import 'package:typed_mock/typed_mock.dart'; 20 import 'package:typed_mock/typed_mock.dart';
20 import 'package:unittest/unittest.dart';
21 21
22 import 'mocks.dart'; 22 import 'mocks.dart';
23 import 'utils.dart'; 23 import 'utils.dart';
24 24
25 main() { 25 main() {
26 initializeTestEnvironment(); 26 initializeTestEnvironment();
27 defineReflectiveTests(AnalysisErrorTest); 27 defineReflectiveSuite(() {
28 defineReflectiveTests(EnumTest); 28 defineReflectiveTests(AnalysisErrorTest);
29 defineReflectiveTests(EnumTest);
30 });
29 } 31 }
30 32
31 class AnalysisErrorMock extends TypedMock implements engine.AnalysisError {} 33 class AnalysisErrorMock extends TypedMock implements engine.AnalysisError {}
32 34
33 @reflectiveTest 35 @reflectiveTest
34 class AnalysisErrorTest { 36 class AnalysisErrorTest {
35 engine.Source source = new MockSource(); 37 engine.Source source = new MockSource();
36 engine.LineInfo lineInfo; 38 engine.LineInfo lineInfo;
37 engine.AnalysisError engineError = new AnalysisErrorMock(); 39 engine.AnalysisError engineError = new AnalysisErrorMock();
38 40
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 ApiEnum apiValue = convert(engineValue); 189 ApiEnum apiValue = convert(engineValue);
188 expect(apiValue, equals(expectedResult)); 190 expect(apiValue, equals(expectedResult));
189 } 191 }
190 } else { 192 } else {
191 ApiEnum apiValue = convert(engineValue); 193 ApiEnum apiValue = convert(engineValue);
192 expect(apiValue.name, equals(enumName)); 194 expect(apiValue.name, equals(enumName));
193 } 195 }
194 }); 196 });
195 } 197 }
196 } 198 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698