OLD | NEW |
1 library pub.test.preprocess_test; | 1 library pub.test.preprocess_test; |
| 2 import 'package:pub_semver/pub_semver.dart'; |
2 import 'package:unittest/unittest.dart'; | 3 import 'package:unittest/unittest.dart'; |
3 import '../lib/src/preprocess.dart'; | 4 import '../lib/src/preprocess.dart'; |
4 import '../lib/src/version.dart'; | |
5 import 'test_pub.dart'; | 5 import 'test_pub.dart'; |
6 main() { | 6 main() { |
7 initConfig(); | 7 initConfig(); |
8 test("does nothing on a file without preprocessor directives", () { | 8 test("does nothing on a file without preprocessor directives", () { |
9 var text = ''' | 9 var text = ''' |
10 some text | 10 some text |
11 // normal comment | 11 // normal comment |
12 // # | 12 // # |
13 //# not beginning of line | 13 //# not beginning of line |
14 '''; | 14 '''; |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 //# else barback <0.5.0 | 261 //# else barback <0.5.0 |
262 //# end | 262 //# end |
263 '''), throwsFormatException); | 263 '''), throwsFormatException); |
264 }); | 264 }); |
265 }); | 265 }); |
266 }); | 266 }); |
267 } | 267 } |
268 String _preprocess(String input) => preprocess(input, { | 268 String _preprocess(String input) => preprocess(input, { |
269 'barback': new Version.parse("1.2.3") | 269 'barback': new Version.parse("1.2.3") |
270 }, 'source/url'); | 270 }, 'source/url'); |
OLD | NEW |