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

Side by Side Diff: pkg/code_transformers/test/resolver_test.dart

Issue 233673003: Deal better with missing sources in code_transformers and polymer (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 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 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 code_transformers.test.resolver_test; 5 library code_transformers.test.resolver_test;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:barback/barback.dart'; 9 import 'package:barback/barback.dart';
10 import 'package:code_transformers/resolver.dart'; 10 import 'package:code_transformers/resolver.dart';
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 120
121 test('handles missing files', () { 121 test('handles missing files', () {
122 return validateResolver( 122 return validateResolver(
123 inputs: { 123 inputs: {
124 'a|web/main.dart': ''' 124 'a|web/main.dart': '''
125 import 'package:b/missing.dart'; 125 import 'package:b/missing.dart';
126 126
127 main() { 127 main() {
128 } ''', 128 } ''',
129 }, 129 },
130 messages: [
131 'warning: Asset not found: b|lib/missing.dart',
132 ],
130 validator: (resolver) { 133 validator: (resolver) {
131 var lib = resolver.getLibrary(entryPoint); 134 var lib = resolver.getLibrary(entryPoint);
132 expect(lib.importedLibraries.length, 1); 135 expect(lib.importedLibraries.length, 1);
133 }); 136 });
134 }); 137 });
135 138
136 test('should update on changed package imports', () { 139 test('should update on changed package imports', () {
137 return validateResolver( 140 return validateResolver(
138 inputs: { 141 inputs: {
139 'a|web/main.dart': ''' 142 'a|web/main.dart': '''
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 359
357 // TODO(nweiz): This should just take an AssetId when barback <0.13.0 support 360 // TODO(nweiz): This should just take an AssetId when barback <0.13.0 support
358 // is dropped. 361 // is dropped.
359 Future<bool> isPrimary(idOrAsset) { 362 Future<bool> isPrimary(idOrAsset) {
360 var id = idOrAsset is AssetId ? idOrAsset : idOrAsset.id; 363 var id = idOrAsset is AssetId ? idOrAsset : idOrAsset.id;
361 return new Future.value(id == primary); 364 return new Future.value(id == primary);
362 } 365 }
363 366
364 applyResolver(Transform transform, Resolver resolver) => validator(resolver); 367 applyResolver(Transform transform, Resolver resolver) => validator(resolver);
365 } 368 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698