Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Unified Diff: pkg/analyzer/test/file_system/resource_uri_resolver_test.dart

Issue 372763003: Move file_system libraries into 'analyzer'. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/analyzer/test/file_system/resource_uri_resolver_test.dart
diff --git a/pkg/analyzer/test/file_system/resource_uri_resolver_test.dart b/pkg/analyzer/test/file_system/resource_uri_resolver_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..76761cbc8bd2e52bcc48a4ffdeae78f223c67be6
--- /dev/null
+++ b/pkg/analyzer/test/file_system/resource_uri_resolver_test.dart
@@ -0,0 +1,64 @@
+// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
+// 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;
+
+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:unittest/unittest.dart';
+
+
+main() {
+ groupSep = ' | ';
+ group('ResourceUriResolver', () {
+ MemoryResourceProvider provider;
+ ResourceUriResolver resolver;
+
+ setUp(() {
+ provider = new MemoryResourceProvider();
+ resolver = new ResourceUriResolver(provider);
+ provider.newFile('/test.dart', '');
+ provider.newFolder('/folder');
+ });
+
+ group('fromEncoding', () {
+ test('file', () {
+ var uri = new Uri(path: '/test.dart');
+ Source source = resolver.fromEncoding(UriKind.FILE_URI, uri);
+ expect(source, isNotNull);
+ expect(source.exists(), isTrue);
+ expect(source.fullName, '/test.dart');
+ });
+
+ test('not a UriKind.FILE_URI', () {
+ var uri = new Uri(path: '/test.dart');
+ Source source = resolver.fromEncoding(UriKind.DART_URI, uri);
+ expect(source, isNull);
+ });
+ });
+
+ group('resolveAbsolute', () {
+ test('file', () {
+ var uri = new Uri(scheme: 'file', path: '/test.dart');
+ Source source = resolver.resolveAbsolute(uri);
+ expect(source, isNotNull);
+ expect(source.exists(), isTrue);
+ expect(source.fullName, '/test.dart');
+ });
+
+ test('folder', () {
+ var uri = new Uri(scheme: 'file', path: '/folder');
+ Source source = resolver.resolveAbsolute(uri);
+ expect(source, isNull);
+ });
+
+ test('not a file URI', () {
+ var uri = new Uri(scheme: 'https', path: '127.0.0.1/test.dart');
+ Source source = resolver.resolveAbsolute(uri);
+ expect(source, isNull);
+ });
+ });
+ });
+}
« no previous file with comments | « pkg/analyzer/test/file_system/physical_resource_provider_test.dart ('k') | pkg/analyzer/test/file_system/test_all.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698