OLD | NEW |
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 analyzer.test.file_system.resource_uri_resolver_test; | 5 library analyzer.test.file_system.resource_uri_resolver_test; |
6 | 6 |
7 import 'package:analyzer/file_system/file_system.dart'; | 7 import 'package:analyzer/file_system/file_system.dart'; |
8 import 'package:analyzer/file_system/memory_file_system.dart'; | 8 import 'package:analyzer/file_system/memory_file_system.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 | |
13 import '../utils.dart'; | |
14 | 12 |
15 main() { | 13 main() { |
16 initializeTestEnvironment(); | 14 defineReflectiveSuite(() { |
17 defineReflectiveTests(ResourceUriResolverTest); | 15 defineReflectiveTests(ResourceUriResolverTest); |
| 16 }); |
18 } | 17 } |
19 | 18 |
20 @reflectiveTest | 19 @reflectiveTest |
21 class ResourceUriResolverTest { | 20 class ResourceUriResolverTest { |
22 MemoryResourceProvider provider; | 21 MemoryResourceProvider provider; |
23 ResourceUriResolver resolver; | 22 ResourceUriResolver resolver; |
24 | 23 |
25 void setUp() { | 24 void setUp() { |
26 provider = new MemoryResourceProvider(); | 25 provider = new MemoryResourceProvider(); |
27 resolver = new ResourceUriResolver(provider); | 26 resolver = new ResourceUriResolver(provider); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 var uri = provider.pathContext.toUri(provider.convertPath('/test.dart')); | 63 var uri = provider.pathContext.toUri(provider.convertPath('/test.dart')); |
65 Source source = resolver.resolveAbsolute(uri); | 64 Source source = resolver.resolveAbsolute(uri); |
66 expect(source, isNotNull); | 65 expect(source, isNotNull); |
67 expect(resolver.restoreAbsolute(source), uri); | 66 expect(resolver.restoreAbsolute(source), uri); |
68 expect( | 67 expect( |
69 resolver.restoreAbsolute( | 68 resolver.restoreAbsolute( |
70 new NonExistingSource(source.fullName, null, null)), | 69 new NonExistingSource(source.fullName, null, null)), |
71 uri); | 70 uri); |
72 } | 71 } |
73 } | 72 } |
OLD | NEW |