| 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 | 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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 'a|web/main.dart': ''' | 175 'a|web/main.dart': ''' |
| 176 import '/b.dart'; | 176 import '/b.dart'; |
| 177 | 177 |
| 178 main() { | 178 main() { |
| 179 } ''', | 179 } ''', |
| 180 }, | 180 }, |
| 181 messages: [ | 181 messages: [ |
| 182 // First from the AST walker | 182 // First from the AST walker |
| 183 'error: absolute paths not allowed: "/b.dart" (web/main.dart 0 14)', | 183 'error: absolute paths not allowed: "/b.dart" (web/main.dart 0 14)', |
| 184 'error: absolute paths not allowed: "/b.dart"', | 184 'error: absolute paths not allowed: "/b.dart"', |
| 185 // TODO: remove this when analyzer is updated. | |
| 186 'error: absolute paths not allowed: "/b.dart"', | |
| 187 ], | 185 ], |
| 188 validator: (resolver) { | 186 validator: (resolver) { |
| 189 var lib = resolver.getLibrary(entryPoint); | 187 var lib = resolver.getLibrary(entryPoint); |
| 190 expect(lib.importedLibraries.length, 1); | 188 expect(lib.importedLibraries.length, 1); |
| 191 }); | 189 }); |
| 192 }); | 190 }); |
| 193 | 191 |
| 194 test('should list all libraries', () { | 192 test('should list all libraries', () { |
| 195 return validateResolver( | 193 return validateResolver( |
| 196 inputs: { | 194 inputs: { |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 | 351 |
| 354 TestTransformer(Resolvers resolvers, this.primary, this.validator) { | 352 TestTransformer(Resolvers resolvers, this.primary, this.validator) { |
| 355 this.resolvers = resolvers; | 353 this.resolvers = resolvers; |
| 356 } | 354 } |
| 357 | 355 |
| 358 Future<bool> isPrimary(Asset input) => | 356 Future<bool> isPrimary(Asset input) => |
| 359 new Future.value(input.id == primary); | 357 new Future.value(input.id == primary); |
| 360 | 358 |
| 361 applyResolver(Transform transform, Resolver resolver) => validator(resolver); | 359 applyResolver(Transform transform, Resolver resolver) => validator(resolver); |
| 362 } | 360 } |
| OLD | NEW |