| 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.assets_test; | 5 library code_transformers.test.assets_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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 expectation: true); | 69 expectation: true); |
| 70 }); | 70 }); |
| 71 | 71 |
| 72 test('should count parts as main', () { | 72 test('should count parts as main', () { |
| 73 return checkDartEntry( | 73 return checkDartEntry( |
| 74 inputs: { | 74 inputs: { |
| 75 'a|web/main.dart': 'part "foo.dart";', | 75 'a|web/main.dart': 'part "foo.dart";', |
| 76 }, | 76 }, |
| 77 expectation: true); | 77 expectation: true); |
| 78 }); | 78 }); |
| 79 |
| 80 test('is tolerant of syntax errors with main', () { |
| 81 return checkDartEntry( |
| 82 inputs: { |
| 83 'a|web/main.dart': 'main() {} {', |
| 84 }, |
| 85 expectation: true); |
| 86 }); |
| 87 |
| 88 test('is tolerant of syntax errors without main', () { |
| 89 return checkDartEntry( |
| 90 inputs: { |
| 91 'a|web/main.dart': 'class Foo {', |
| 92 }, |
| 93 expectation: false); |
| 94 }); |
| 79 }); | 95 }); |
| 80 } | 96 } |
| 81 | 97 |
| 82 class Validator extends Transformer { | 98 class Validator extends Transformer { |
| 83 final Function validation; | 99 final Function validation; |
| 84 | 100 |
| 85 Validator(this.validation); | 101 Validator(this.validation); |
| 86 | 102 |
| 87 Future<bool> isPrimary(Asset input) => new Future.value(true); | 103 Future<bool> isPrimary(Asset input) => new Future.value(true); |
| 88 | 104 |
| 89 Future apply(Transform transform) { | 105 Future apply(Transform transform) { |
| 90 return new Future.value(validation(transform)); | 106 return new Future.value(validation(transform)); |
| 91 } | 107 } |
| 92 } | 108 } |
| OLD | NEW |