OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS d.file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS d.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_tests; | 5 library pub_tests; |
6 | 6 |
7 import 'package:scheduled_test/scheduled_test.dart'; | 7 import 'package:scheduled_test/scheduled_test.dart'; |
8 | 8 |
9 import '../descriptor.dart' as d; | 9 import '../descriptor.dart' as d; |
10 import '../test_pub.dart'; | 10 import '../test_pub.dart'; |
11 | 11 |
12 main() { | 12 main() { |
13 initConfig(); | 13 initConfig(); |
14 | 14 |
15 // An import error will cause the isolate API to fail synchronously while | 15 // An import error will cause the isolate API to fail synchronously while |
16 // loading the transformer. | 16 // loading the transformer. |
17 integration("fails to load a transform with an import error", () { | 17 integration("fails to load a transform with an import error", () { |
18 d.dir(appPath, [ | 18 d.dir(appPath, [ |
19 d.pubspec({ | 19 d.pubspec({ |
20 "name": "myapp", | 20 "name": "myapp", |
21 "transformers": ["myapp/src/transformer"] | 21 "transformers": ["myapp/src/transformer"] |
22 }), | 22 }), |
23 d.dir("lib", [d.dir("src", [ | 23 d.dir("lib", [d.dir("src", [ |
24 d.file("transformer.dart", "import 'does/not/exist.dart';") | 24 d.file("transformer.dart", "import 'does/not/exist.dart';") |
25 ])]) | 25 ])]) |
26 ]).create(); | 26 ]).create(); |
27 | 27 |
28 createLockFile('myapp', pkg: ['barback']); | 28 createLockFile('myapp', pkg: ['barback']); |
29 | |
30 var pub = startPub(args: ['serve', '--port=0', "--hostname=127.0.0.1"]); | 29 var pub = startPub(args: ['serve', '--port=0', "--hostname=127.0.0.1"]); |
31 expect(pub.nextErrLine(), completion(matches(new RegExp( | 30 expect(pub.nextErrLine(), completion(matches(new RegExp( |
32 r"Error: line 1 pos 1: library handler failed$")))); | 31 r"Error: line 1 pos 1: library handler failed$")))); |
33 pub.shouldExit(1); | 32 pub.shouldExit(1); |
34 }); | 33 }); |
35 } | 34 } |
OLD | NEW |