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

Side by Side Diff: pkg/analysis_server/test/src/utilities/change_builder_dart_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) 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 analysis_server.test.src.utilities.change_builder_dart_test; 5 library analysis_server.test.src.utilities.change_builder_dart_test;
6 6
7 import 'package:analysis_server/plugin/protocol/protocol.dart'; 7 import 'package:analysis_server/plugin/protocol/protocol.dart';
8 import 'package:analysis_server/src/provisional/edit/utilities/change_builder_co re.dart'; 8 import 'package:analysis_server/src/provisional/edit/utilities/change_builder_co re.dart';
9 import 'package:analysis_server/src/provisional/edit/utilities/change_builder_da rt.dart'; 9 import 'package:analysis_server/src/provisional/edit/utilities/change_builder_da rt.dart';
10 import 'package:analysis_server/src/utilities/change_builder_dart.dart'; 10 import 'package:analysis_server/src/utilities/change_builder_dart.dart';
11 import 'package:analyzer/dart/ast/ast.dart'; 11 import 'package:analyzer/dart/ast/ast.dart';
12 import 'package:analyzer/dart/element/element.dart'; 12 import 'package:analyzer/dart/element/element.dart';
13 import 'package:analyzer/src/generated/source.dart'; 13 import 'package:analyzer/src/generated/source.dart';
14 import 'package:test/test.dart';
14 import 'package:test_reflective_loader/test_reflective_loader.dart'; 15 import 'package:test_reflective_loader/test_reflective_loader.dart';
15 import 'package:unittest/unittest.dart';
16 16
17 import '../../abstract_context.dart'; 17 import '../../abstract_context.dart';
18 import '../../utils.dart'; 18 import '../../utils.dart';
19 19
20 main() { 20 main() {
21 initializeTestEnvironment(); 21 initializeTestEnvironment();
22 defineReflectiveTests(DartChangeBuilderImplTest); 22 defineReflectiveSuite(() {
23 defineReflectiveTests(DartEditBuilderImplTest); 23 defineReflectiveTests(DartChangeBuilderImplTest);
24 defineReflectiveTests(DartFileEditBuilderImplTest); 24 defineReflectiveTests(DartEditBuilderImplTest);
25 defineReflectiveTests(DartFileEditBuilderImplTest);
26 });
25 } 27 }
26 28
27 @reflectiveTest 29 @reflectiveTest
28 class DartChangeBuilderImplTest extends AbstractContextTest { 30 class DartChangeBuilderImplTest extends AbstractContextTest {
29 void test_createFileEditBuilder() { 31 void test_createFileEditBuilder() {
30 Source source = addSource('/test.dart', 'library test;'); 32 Source source = addSource('/test.dart', 'library test;');
31 resolveLibraryUnit(source); 33 resolveLibraryUnit(source);
32 int timeStamp = 54; 34 int timeStamp = 54;
33 DartChangeBuilderImpl builder = new DartChangeBuilderImpl(context); 35 DartChangeBuilderImpl builder = new DartChangeBuilderImpl(context);
34 DartFileEditBuilderImpl fileEditBuilder = 36 DartFileEditBuilderImpl fileEditBuilder =
(...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 DartEditBuilderImpl editBuilder = (builder as DartFileEditBuilderImpl) 792 DartEditBuilderImpl editBuilder = (builder as DartFileEditBuilderImpl)
791 .createEditBuilder(offset, length); 793 .createEditBuilder(offset, length);
792 expect(editBuilder, new isInstanceOf<DartEditBuilder>()); 794 expect(editBuilder, new isInstanceOf<DartEditBuilder>());
793 SourceEdit sourceEdit = editBuilder.sourceEdit; 795 SourceEdit sourceEdit = editBuilder.sourceEdit;
794 expect(sourceEdit.length, length); 796 expect(sourceEdit.length, length);
795 expect(sourceEdit.offset, offset); 797 expect(sourceEdit.offset, offset);
796 expect(sourceEdit.replacement, isEmpty); 798 expect(sourceEdit.replacement, isEmpty);
797 }); 799 });
798 } 800 }
799 } 801 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698