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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 library test.resource_uri_resolver;
6
7 import 'package:analyzer/file_system/file_system.dart';
8 import 'package:analyzer/file_system/memory_file_system.dart';
9 import 'package:analyzer/src/generated/source.dart';
10 import 'package:unittest/unittest.dart';
11
12
13 main() {
14 groupSep = ' | ';
15 group('ResourceUriResolver', () {
16 MemoryResourceProvider provider;
17 ResourceUriResolver resolver;
18
19 setUp(() {
20 provider = new MemoryResourceProvider();
21 resolver = new ResourceUriResolver(provider);
22 provider.newFile('/test.dart', '');
23 provider.newFolder('/folder');
24 });
25
26 group('fromEncoding', () {
27 test('file', () {
28 var uri = new Uri(path: '/test.dart');
29 Source source = resolver.fromEncoding(UriKind.FILE_URI, uri);
30 expect(source, isNotNull);
31 expect(source.exists(), isTrue);
32 expect(source.fullName, '/test.dart');
33 });
34
35 test('not a UriKind.FILE_URI', () {
36 var uri = new Uri(path: '/test.dart');
37 Source source = resolver.fromEncoding(UriKind.DART_URI, uri);
38 expect(source, isNull);
39 });
40 });
41
42 group('resolveAbsolute', () {
43 test('file', () {
44 var uri = new Uri(scheme: 'file', path: '/test.dart');
45 Source source = resolver.resolveAbsolute(uri);
46 expect(source, isNotNull);
47 expect(source.exists(), isTrue);
48 expect(source.fullName, '/test.dart');
49 });
50
51 test('folder', () {
52 var uri = new Uri(scheme: 'file', path: '/folder');
53 Source source = resolver.resolveAbsolute(uri);
54 expect(source, isNull);
55 });
56
57 test('not a file URI', () {
58 var uri = new Uri(scheme: 'https', path: '127.0.0.1/test.dart');
59 Source source = resolver.resolveAbsolute(uri);
60 expect(source, isNull);
61 });
62 });
63 });
64 }
OLDNEW
« 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