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 library test.source.sdk_ext; | 5 library test.source.sdk_ext; |
6 | 6 |
7 import 'package:analyzer/file_system/memory_file_system.dart'; | 7 import 'package:analyzer/file_system/memory_file_system.dart'; |
8 import 'package:analyzer/source/sdk_ext.dart'; | 8 import 'package:analyzer/source/sdk_ext.dart'; |
9 import 'package:unittest/unittest.dart'; | 9 import 'package:unittest/unittest.dart'; |
10 | 10 |
| 11 import '../utils.dart'; |
| 12 |
11 main() { | 13 main() { |
12 groupSep = ' | '; | 14 initializeTestEnvironment(); |
13 group('SdkExtUriResolverTest', () { | 15 group('SdkExtUriResolverTest', () { |
14 setUp(() { | 16 setUp(() { |
15 buildResourceProvider(); | 17 buildResourceProvider(); |
16 }); | 18 }); |
17 tearDown(() { | 19 tearDown(() { |
18 clearResourceProvider(); | 20 clearResourceProvider(); |
19 }); | 21 }); |
20 test('test_NullPackageMap', () { | 22 test('test_NullPackageMap', () { |
21 var resolver = new SdkExtUriResolver(null); | 23 var resolver = new SdkExtUriResolver(null); |
22 expect(resolver.length, equals(0)); | 24 expect(resolver.length, equals(0)); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 }); | 76 }); |
75 }); | 77 }); |
76 } | 78 } |
77 | 79 |
78 MemoryResourceProvider resourceProvider; | 80 MemoryResourceProvider resourceProvider; |
79 | 81 |
80 buildResourceProvider() { | 82 buildResourceProvider() { |
81 resourceProvider = new MemoryResourceProvider(); | 83 resourceProvider = new MemoryResourceProvider(); |
82 resourceProvider.newFolder('/empty'); | 84 resourceProvider.newFolder('/empty'); |
83 resourceProvider.newFolder('/tmp'); | 85 resourceProvider.newFolder('/tmp'); |
84 resourceProvider.newFile('/tmp/_sdkext', r''' | 86 resourceProvider.newFile( |
| 87 '/tmp/_sdkext', |
| 88 r''' |
85 { | 89 { |
86 "dart:fox": "slippy.dart", | 90 "dart:fox": "slippy.dart", |
87 "dart:bear": "grizzly.dart", | 91 "dart:bear": "grizzly.dart", |
88 "dart:relative": "../relative.dart", | 92 "dart:relative": "../relative.dart", |
89 "dart:deep": "deep/directory/file.dart", | 93 "dart:deep": "deep/directory/file.dart", |
90 "fart:loudly": "nomatter.dart" | 94 "fart:loudly": "nomatter.dart" |
91 }'''); | 95 }'''); |
92 } | 96 } |
93 | 97 |
94 clearResourceProvider() { | 98 clearResourceProvider() { |
95 resourceProvider = null; | 99 resourceProvider = null; |
96 } | 100 } |
OLD | NEW |