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 test.resource_uri_resolver; | 5 library test.resource_uri_resolver; |
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:unittest/unittest.dart'; | 10 import 'package:unittest/unittest.dart'; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 var uri = new Uri(scheme: 'https', path: '127.0.0.1/test.dart'); | 47 var uri = new Uri(scheme: 'https', path: '127.0.0.1/test.dart'); |
48 Source source = resolver.resolveAbsolute(uri); | 48 Source source = resolver.resolveAbsolute(uri); |
49 expect(source, isNull); | 49 expect(source, isNull); |
50 } | 50 } |
51 | 51 |
52 void test_restoreAbsolute() { | 52 void test_restoreAbsolute() { |
53 var uri = new Uri(scheme: 'file', path: '/test.dart'); | 53 var uri = new Uri(scheme: 'file', path: '/test.dart'); |
54 Source source = resolver.resolveAbsolute(uri); | 54 Source source = resolver.resolveAbsolute(uri); |
55 expect(source, isNotNull); | 55 expect(source, isNotNull); |
56 expect(resolver.restoreAbsolute(source), uri); | 56 expect(resolver.restoreAbsolute(source), uri); |
| 57 expect( |
| 58 resolver.restoreAbsolute( |
| 59 new NonExistingSource(source.fullName, null, null)), |
| 60 uri); |
57 } | 61 } |
58 } | 62 } |
OLD | NEW |