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

Side by Side Diff: pkg/analysis_server/test/services/correction/change_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.services.correction.change; 5 library test.services.correction.change;
6 6
7 import 'package:analysis_server/src/constants.dart'; 7 import 'package:analysis_server/src/constants.dart';
8 import 'package:analysis_server/src/protocol_server.dart'; 8 import 'package:analysis_server/src/protocol_server.dart';
9 import 'package:analyzer/src/generated/source.dart'; 9 import 'package:analyzer/src/generated/source.dart';
10 import 'package:test/test.dart';
10 import 'package:test_reflective_loader/test_reflective_loader.dart'; 11 import 'package:test_reflective_loader/test_reflective_loader.dart';
11 import 'package:unittest/unittest.dart';
12 12
13 import '../../utils.dart'; 13 import '../../utils.dart';
14 14
15 main() { 15 main() {
16 initializeTestEnvironment(); 16 initializeTestEnvironment();
17 defineReflectiveTests(ChangeTest); 17 defineReflectiveSuite(() {
18 defineReflectiveTests(EditTest); 18 defineReflectiveTests(ChangeTest);
19 defineReflectiveTests(FileEditTest); 19 defineReflectiveTests(EditTest);
20 defineReflectiveTests(LinkedEditGroupTest); 20 defineReflectiveTests(FileEditTest);
21 defineReflectiveTests(LinkedEditSuggestionTest); 21 defineReflectiveTests(LinkedEditGroupTest);
22 defineReflectiveTests(PositionTest); 22 defineReflectiveTests(LinkedEditSuggestionTest);
23 defineReflectiveTests(PositionTest);
24 });
23 } 25 }
24 26
25 @reflectiveTest 27 @reflectiveTest
26 class ChangeTest { 28 class ChangeTest {
27 void test_addEdit() { 29 void test_addEdit() {
28 SourceChange change = new SourceChange('msg'); 30 SourceChange change = new SourceChange('msg');
29 SourceEdit edit1 = new SourceEdit(1, 2, 'a'); 31 SourceEdit edit1 = new SourceEdit(1, 2, 'a');
30 SourceEdit edit2 = new SourceEdit(1, 2, 'b'); 32 SourceEdit edit2 = new SourceEdit(1, 2, 'b');
31 expect(change.edits, hasLength(0)); 33 expect(change.edits, hasLength(0));
32 change.addEdit('/a.dart', 0, edit1); 34 change.addEdit('/a.dart', 0, edit1);
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 expect(position.offset, 1); 292 expect(position.offset, 1);
291 expect(position.toString(), '{"file":"/test.dart","offset":1}'); 293 expect(position.toString(), '{"file":"/test.dart","offset":1}');
292 } 294 }
293 295
294 void test_toJson() { 296 void test_toJson() {
295 Position position = new Position('/test.dart', 1); 297 Position position = new Position('/test.dart', 1);
296 var expectedJson = {FILE: '/test.dart', OFFSET: 1}; 298 var expectedJson = {FILE: '/test.dart', OFFSET: 1};
297 expect(position.toJson(), expectedJson); 299 expect(position.toJson(), expectedJson);
298 } 300 }
299 } 301 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698