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