| Index: packages/analyzer/test/file_system/resource_uri_resolver_test.dart
|
| diff --git a/packages/analyzer/test/file_system/resource_uri_resolver_test.dart b/packages/analyzer/test/file_system/resource_uri_resolver_test.dart
|
| index 8d91d2454dd517b54ee4e1cc9f00f3af34faab0c..482149b84ff0a3f10dc757728d6973e452832a99 100644
|
| --- a/packages/analyzer/test/file_system/resource_uri_resolver_test.dart
|
| +++ b/packages/analyzer/test/file_system/resource_uri_resolver_test.dart
|
| @@ -2,19 +2,19 @@
|
| // for details. All rights reserved. Use of this source code is governed by a
|
| // BSD-style license that can be found in the LICENSE file.
|
|
|
| -library test.resource_uri_resolver;
|
| +library analyzer.test.file_system.resource_uri_resolver_test;
|
|
|
| import 'package:analyzer/file_system/file_system.dart';
|
| import 'package:analyzer/file_system/memory_file_system.dart';
|
| import 'package:analyzer/src/generated/source.dart';
|
| +import 'package:test_reflective_loader/test_reflective_loader.dart';
|
| import 'package:unittest/unittest.dart';
|
|
|
| -import '../reflective_tests.dart';
|
| import '../utils.dart';
|
|
|
| main() {
|
| initializeTestEnvironment();
|
| - runReflectiveTests(ResourceUriResolverTest);
|
| + defineReflectiveTests(ResourceUriResolverTest);
|
| }
|
|
|
| @reflectiveTest
|
| @@ -25,32 +25,43 @@ class ResourceUriResolverTest {
|
| void setUp() {
|
| provider = new MemoryResourceProvider();
|
| resolver = new ResourceUriResolver(provider);
|
| - provider.newFile('/test.dart', '');
|
| - provider.newFolder('/folder');
|
| + provider.newFile(provider.convertPath('/test.dart'), '');
|
| + provider.newFolder(provider.convertPath('/folder'));
|
| + }
|
| +
|
| + void test_creation() {
|
| + expect(provider, isNotNull);
|
| + expect(resolver, isNotNull);
|
| }
|
|
|
| void test_resolveAbsolute_file() {
|
| - var uri = new Uri(scheme: 'file', path: '/test.dart');
|
| + var uri = provider.pathContext.toUri(provider.convertPath('/test.dart'));
|
| Source source = resolver.resolveAbsolute(uri);
|
| expect(source, isNotNull);
|
| expect(source.exists(), isTrue);
|
| - expect(source.fullName, '/test.dart');
|
| + expect(source.fullName, provider.convertPath('/test.dart'));
|
| }
|
|
|
| void test_resolveAbsolute_folder() {
|
| - var uri = new Uri(scheme: 'file', path: '/folder');
|
| + var uri = provider.pathContext.toUri(provider.convertPath('/folder'));
|
| + Source source = resolver.resolveAbsolute(uri);
|
| + expect(source, isNull);
|
| + }
|
| +
|
| + void test_resolveAbsolute_notFile_dartUri() {
|
| + var uri = new Uri(scheme: 'dart', path: 'core');
|
| Source source = resolver.resolveAbsolute(uri);
|
| expect(source, isNull);
|
| }
|
|
|
| - void test_resolveAbsolute_notFile() {
|
| + void test_resolveAbsolute_notFile_httpsUri() {
|
| var uri = new Uri(scheme: 'https', path: '127.0.0.1/test.dart');
|
| Source source = resolver.resolveAbsolute(uri);
|
| expect(source, isNull);
|
| }
|
|
|
| void test_restoreAbsolute() {
|
| - var uri = new Uri(scheme: 'file', path: '/test.dart');
|
| + var uri = provider.pathContext.toUri(provider.convertPath('/test.dart'));
|
| Source source = resolver.resolveAbsolute(uri);
|
| expect(source, isNotNull);
|
| expect(resolver.restoreAbsolute(source), uri);
|
|
|