OLD | NEW |
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 import 'package:analysis_server/src/services/dependencies/reachable_source_colle
ctor.dart'; | 5 import 'package:analysis_server/src/services/dependencies/reachable_source_colle
ctor.dart'; |
6 import 'package:analyzer/src/generated/source.dart'; | 6 import 'package:analyzer/src/generated/source.dart'; |
7 import 'package:test/test.dart'; | 7 import 'package:test/test.dart'; |
8 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 8 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
9 | 9 |
10 import '../../abstract_context.dart'; | 10 import '../../abstract_context.dart'; |
11 | 11 |
12 main() { | 12 main() { |
13 defineReflectiveSuite(() { | 13 defineReflectiveSuite(() { |
14 defineReflectiveTests(ReachableSourceCollectorTest); | 14 defineReflectiveTests(ReachableSourceCollectorTest); |
15 }); | 15 }); |
16 } | 16 } |
17 | 17 |
18 @reflectiveTest | 18 @reflectiveTest |
19 class ReachableSourceCollectorTest extends AbstractContextTest { | 19 class ReachableSourceCollectorTest extends AbstractContextTest { |
20 Map<String, List<String>> importsFor(Source source) => | 20 Map<String, List<String>> importsFor(Source source) => |
21 new ReachableSourceCollector(source, context).collectSources(); | 21 new ReachableSourceCollector(source, null).collectSources(); |
22 | 22 |
23 test_null_context() { | 23 test_null_context() { |
24 Source lib = addSource('/lib.dart', ''); | 24 Source lib = addSource('/lib.dart', ''); |
25 expect(() => new ReachableSourceCollector(lib, null), | 25 expect(() => new ReachableSourceCollector(lib, null), |
26 throwsA(new isInstanceOf<ArgumentError>())); | 26 throwsA(new isInstanceOf<ArgumentError>())); |
27 } | 27 } |
28 | 28 |
29 @failingTest | 29 @failingTest |
30 test_null_source() { | 30 test_null_source() { |
31 // See https://github.com/dart-lang/sdk/issues/29311 | 31 // See https://github.com/dart-lang/sdk/issues/29311 |
32 fail('The analysis.getReachableSources is not implemented.'); | 32 fail('The analysis.getReachableSources is not implemented.'); |
33 expect(() => new ReachableSourceCollector(null, context), | 33 expect(() => new ReachableSourceCollector(null, null), |
34 throwsA(new isInstanceOf<ArgumentError>())); | 34 throwsA(new isInstanceOf<ArgumentError>())); |
35 } | 35 } |
36 | 36 |
37 @failingTest | 37 @failingTest |
38 test_sources() { | 38 test_sources() { |
39 // See https://github.com/dart-lang/sdk/issues/29311 | 39 // See https://github.com/dart-lang/sdk/issues/29311 |
40 fail('The analysis.getReachableSources is not implemented.'); | 40 fail('The analysis.getReachableSources is not implemented.'); |
41 Source lib1 = addSource( | 41 Source lib1 = addSource( |
42 '/lib1.dart', | 42 '/lib1.dart', |
43 ''' | 43 ''' |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 unorderedEquals([ | 75 unorderedEquals([ |
76 'dart:_internal', | 76 'dart:_internal', |
77 'dart:async', | 77 'dart:async', |
78 'dart:core', | 78 'dart:core', |
79 'dart:math', | 79 'dart:math', |
80 'file:///lib3.dart', | 80 'file:///lib3.dart', |
81 'file:///lib4.dart' | 81 'file:///lib4.dart' |
82 ])); | 82 ])); |
83 } | 83 } |
84 } | 84 } |
OLD | NEW |