| OLD | NEW |
| 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 import 'dart:io' show File, Platform; | 8 import 'dart:io' show File, Platform; |
| 9 | 9 |
| 10 import 'package:barback/barback.dart'; | 10 import 'package:barback/barback.dart'; |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 return validateResolver( | 154 return validateResolver( |
| 155 inputs: { | 155 inputs: { |
| 156 'a|web/main.dart': ''' | 156 'a|web/main.dart': ''' |
| 157 import 'package:b/b.dart'; | 157 import 'package:b/b.dart'; |
| 158 | 158 |
| 159 main() { | 159 main() { |
| 160 } ''', | 160 } ''', |
| 161 }, | 161 }, |
| 162 messages: [ | 162 messages: [ |
| 163 'error: Unable to find asset for "package:b/b.dart"', | 163 'error: Unable to find asset for "package:b/b.dart"', |
| 164 'error: Unable to find asset for "package:b/b.dart"', | |
| 165 ], | 164 ], |
| 166 validator: (resolver) { | 165 validator: (resolver) { |
| 167 var lib = resolver.entryLibrary; | 166 var lib = resolver.entryLibrary; |
| 168 expect(lib.importedLibraries.length, 1); | 167 expect(lib.importedLibraries.length, 1); |
| 169 }); | 168 }); |
| 170 }); | 169 }); |
| 171 | 170 |
| 172 test('should fail on absolute URIs', () { | 171 test('should fail on absolute URIs', () { |
| 173 return validateResolver( | 172 return validateResolver( |
| 174 inputs: { | 173 inputs: { |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 this.resolvers = resolvers; | 351 this.resolvers = resolvers; |
| 353 } | 352 } |
| 354 | 353 |
| 355 Future<bool> isPrimary(Asset input) => | 354 Future<bool> isPrimary(Asset input) => |
| 356 new Future.value(input.id == primary); | 355 new Future.value(input.id == primary); |
| 357 | 356 |
| 358 applyResolver(Transform transform, Resolver resolver) { | 357 applyResolver(Transform transform, Resolver resolver) { |
| 359 return validator(resolver); | 358 return validator(resolver); |
| 360 } | 359 } |
| 361 } | 360 } |
| OLD | NEW |