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 pub.test.preprocess_test; | |
6 | |
7 import 'package:pub/src/preprocess.dart'; | 5 import 'package:pub/src/preprocess.dart'; |
8 import 'package:pub_semver/pub_semver.dart'; | 6 import 'package:pub_semver/pub_semver.dart'; |
9 import 'package:test/test.dart'; | 7 import 'package:test/test.dart'; |
10 | 8 |
11 main() { | 9 main() { |
12 test("does nothing on a file without preprocessor directives", () { | 10 test("does nothing on a file without preprocessor directives", () { |
13 var text = ''' | 11 var text = ''' |
14 some text | 12 some text |
15 // normal comment | 13 // normal comment |
16 // # | 14 // # |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 //# else barback <0.5.0 | 288 //# else barback <0.5.0 |
291 //# end | 289 //# end |
292 '''), throwsFormatException); | 290 '''), throwsFormatException); |
293 }); | 291 }); |
294 }); | 292 }); |
295 }); | 293 }); |
296 } | 294 } |
297 | 295 |
298 String _preprocess(String input) => | 296 String _preprocess(String input) => |
299 preprocess(input, {'barback': new Version.parse("1.2.3")}, 'source/url'); | 297 preprocess(input, {'barback': new Version.parse("1.2.3")}, 'source/url'); |
OLD | NEW |