OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 import 'package:analysis_server/src/services/index/index.dart'; | 5 import 'package:analysis_server/src/services/index/index.dart'; |
6 import 'package:analyzer/dart/ast/ast.dart'; | 6 import 'package:analyzer/dart/ast/ast.dart'; |
7 import 'package:analyzer/dart/element/element.dart'; | 7 import 'package:analyzer/dart/element/element.dart'; |
8 import 'package:analyzer/src/generated/source.dart'; | 8 import 'package:analyzer/src/generated/source.dart'; |
9 import 'package:analyzer/src/summary/idl.dart'; | 9 import 'package:analyzer/src/summary/idl.dart'; |
10 import 'package:test/test.dart'; | 10 import 'package:test/test.dart'; |
11 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 11 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
12 import 'package:typed_mock/typed_mock.dart'; | 12 import 'package:typed_mock/typed_mock.dart'; |
13 | 13 |
14 import '../../abstract_single_unit.dart'; | 14 import '../../abstract_single_unit.dart'; |
15 import '../../utils.dart'; | |
16 | 15 |
17 main() { | 16 main() { |
18 initializeTestEnvironment(); | |
19 defineReflectiveSuite(() { | 17 defineReflectiveSuite(() { |
20 defineReflectiveTests(IndexTest); | 18 defineReflectiveTests(IndexTest); |
21 }); | 19 }); |
22 } | 20 } |
23 | 21 |
24 @reflectiveTest | 22 @reflectiveTest |
25 class IndexTest extends AbstractSingleUnitTest { | 23 class IndexTest extends AbstractSingleUnitTest { |
26 Index index = createMemoryIndex(); | 24 Index index = createMemoryIndex(); |
27 | 25 |
28 /** | 26 /** |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 Source _indexUnit(String path, String code) { | 368 Source _indexUnit(String path, String code) { |
371 Source source = addSource(path, code); | 369 Source source = addSource(path, code); |
372 CompilationUnit unit = resolveLibraryUnit(source); | 370 CompilationUnit unit = resolveLibraryUnit(source); |
373 index.indexUnit(unit); | 371 index.indexUnit(unit); |
374 return source; | 372 return source; |
375 } | 373 } |
376 } | 374 } |
377 | 375 |
378 class _CompilationUnitElementMock extends TypedMock | 376 class _CompilationUnitElementMock extends TypedMock |
379 implements CompilationUnitElement {} | 377 implements CompilationUnitElement {} |
OLD | NEW |