| 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 // This code was auto-generated, is not intended to be edited, and is subject to | 5 // This code was auto-generated, is not intended to be edited, and is subject to |
| 6 // significant change. Please see the README file for more information. | 6 // significant change. Please see the README file for more information. |
| 7 | 7 |
| 8 library analyzer.test.generated.source_factory; | 8 library analyzer.test.generated.source_factory; |
| 9 | 9 |
| 10 import 'dart:convert'; | 10 import 'dart:convert'; |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 } | 70 } |
| 71 SourceFactory factory = new SourceFactory(resolvers, packages); | 71 SourceFactory factory = new SourceFactory(resolvers, packages); |
| 72 return factory.restoreUri(source); | 72 return factory.restoreUri(source); |
| 73 } | 73 } |
| 74 | 74 |
| 75 group('SourceFactoryTest', () { | 75 group('SourceFactoryTest', () { |
| 76 group('package mapping', () { | 76 group('package mapping', () { |
| 77 group('resolveUri', () { | 77 group('resolveUri', () { |
| 78 test('URI in mapping', () { | 78 test('URI in mapping', () { |
| 79 String uri = resolvePackageUri(config: ''' | 79 String uri = resolvePackageUri(config: ''' |
| 80 unittest:file:///home/somebody/.pub/cache/unittest-0.9.9/lib/ |
| 81 async:file:///home/somebody/.pub/cache/async-1.1.0/lib/ |
| 82 quiver:file:///home/somebody/.pub/cache/quiver-1.2.1/lib |
| 83 ''', uri: 'package:unittest/unittest.dart'); |
| 84 expect(uri, equals( |
| 85 '/home/somebody/.pub/cache/unittest-0.9.9/lib/unittest.dart')); |
| 86 }); |
| 87 test('URI in mapping (no scheme)', () { |
| 88 String uri = resolvePackageUri(config: ''' |
| 80 unittest:/home/somebody/.pub/cache/unittest-0.9.9/lib/ | 89 unittest:/home/somebody/.pub/cache/unittest-0.9.9/lib/ |
| 81 async:/home/somebody/.pub/cache/async-1.1.0/lib/ | 90 async:/home/somebody/.pub/cache/async-1.1.0/lib/ |
| 82 quiver:/home/somebody/.pub/cache/quiver-1.2.1/lib | 91 quiver:/home/somebody/.pub/cache/quiver-1.2.1/lib |
| 83 ''', uri: 'package:unittest/unittest.dart'); | 92 ''', uri: 'package:unittest/unittest.dart'); |
| 84 expect(uri, equals( | 93 expect(uri, equals( |
| 85 '/home/somebody/.pub/cache/unittest-0.9.9/lib/unittest.dart')); | 94 '/home/somebody/.pub/cache/unittest-0.9.9/lib/unittest.dart')); |
| 86 }); | 95 }); |
| 87 test('URI not in mapping', () { | 96 test('URI not in mapping', () { |
| 88 String uri = resolvePackageUri( | 97 String uri = resolvePackageUri( |
| 89 config: 'unittest:/home/somebody/.pub/cache/unittest-0.9.9/lib/', | 98 config: 'unittest:/home/somebody/.pub/cache/unittest-0.9.9/lib/', |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 UriResolver_SourceFactoryTest_test_fromEncoding_valid(this.encoding); | 325 UriResolver_SourceFactoryTest_test_fromEncoding_valid(this.encoding); |
| 317 | 326 |
| 318 @override | 327 @override |
| 319 Source resolveAbsolute(Uri uri) { | 328 Source resolveAbsolute(Uri uri) { |
| 320 if (uri.toString() == encoding) { | 329 if (uri.toString() == encoding) { |
| 321 return new TestSource(); | 330 return new TestSource(); |
| 322 } | 331 } |
| 323 return null; | 332 return null; |
| 324 } | 333 } |
| 325 } | 334 } |
| OLD | NEW |