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

Side by Side Diff: pkg/analyzer/test/generated/source_factory_test.dart

Issue 2265793002: Code clean-up (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 4 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
OLDNEW
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 library analyzer.test.generated.test.generated.source_factory; 5 library analyzer.test.generated.test.generated.source_factory;
6 6
7 import 'dart:convert'; 7 import 'dart:convert';
8 8
9 import 'package:analyzer/file_system/file_system.dart'; 9 import 'package:analyzer/file_system/file_system.dart';
10 import 'package:analyzer/file_system/physical_file_system.dart'; 10 import 'package:analyzer/file_system/physical_file_system.dart';
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 String uri = resolvePackageUri(config: '', uri: 'package:foo'); 139 String uri = resolvePackageUri(config: '', uri: 'package:foo');
140 expect(uri, isNull); 140 expect(uri, isNull);
141 }); 141 });
142 test('Invalid URI', () { 142 test('Invalid URI', () {
143 // TODO(pquitslund): fix clients to handle errors appropriately 143 // TODO(pquitslund): fix clients to handle errors appropriately
144 // CLI: print message 'invalid package file format' 144 // CLI: print message 'invalid package file format'
145 // SERVER: best case tell user somehow and recover... 145 // SERVER: best case tell user somehow and recover...
146 expect( 146 expect(
147 () => resolvePackageUri( 147 () => resolvePackageUri(
148 config: 'foo:<:&%>', uri: 'package:foo/bar.dart'), 148 config: 'foo:<:&%>', uri: 'package:foo/bar.dart'),
149 throwsA(new isInstanceOf('FormatException'))); 149 throwsA(new isInstanceOf<FormatException>()));
150 }); 150 });
151 test('Valid URI that cannot be further resolved', () { 151 test('Valid URI that cannot be further resolved', () {
152 String uri = resolvePackageUri( 152 String uri = resolvePackageUri(
153 config: 'foo:http://www.google.com', uri: 'package:foo/bar.dart'); 153 config: 'foo:http://www.google.com', uri: 'package:foo/bar.dart');
154 expect(uri, isNull); 154 expect(uri, isNull);
155 }); 155 });
156 test('Relative URIs', () { 156 test('Relative URIs', () {
157 Source containingSource = createSource( 157 Source containingSource = createSource(
158 path: '/foo/bar/baz/foo.dart', uri: 'package:foo/foo.dart'); 158 path: '/foo/bar/baz/foo.dart', uri: 'package:foo/foo.dart');
159 String uri = resolvePackageUri( 159 String uri = resolvePackageUri(
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 UriResolver_SourceFactoryTest_test_fromEncoding_valid(this.encoding); 360 UriResolver_SourceFactoryTest_test_fromEncoding_valid(this.encoding);
361 361
362 @override 362 @override
363 Source resolveAbsolute(Uri uri, [Uri actualUri]) { 363 Source resolveAbsolute(Uri uri, [Uri actualUri]) {
364 if (uri.toString() == encoding) { 364 if (uri.toString() == encoding) {
365 return new TestSource(); 365 return new TestSource();
366 } 366 }
367 return null; 367 return null;
368 } 368 }
369 } 369 }
OLDNEW
« no previous file with comments | « pkg/analyzer/test/generated/parser_test.dart ('k') | pkg/analyzer/test/source/embedder_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698