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_tests; | |
6 | |
7 import 'dart:io'; | |
8 | |
9 import 'package:scheduled_test/scheduled_test.dart'; | 5 import 'package:scheduled_test/scheduled_test.dart'; |
| 6 import 'package:scheduled_test/scheduled_stream.dart'; |
10 | 7 |
11 import '../../descriptor.dart' as d; | 8 import '../../descriptor.dart' as d; |
12 import '../../test_pub.dart'; | 9 import '../../test_pub.dart'; |
13 | 10 |
14 main() { | 11 main() { |
15 integration('handles a corrupted binstub script', () { | 12 integration('runs a script in checked mode', () { |
16 servePackages((builder) { | 13 servePackages((builder) { |
17 builder.serve("foo", "1.0.0", contents: [ | 14 builder.serve("foo", "1.0.0", contents: [ |
18 d.dir("bin", [ | 15 d.dir("bin", [ |
19 d.file("script.dart", "main(args) => print('ok');") | 16 d.file("script.dart", "main() { int a = true; }") |
20 ]) | 17 ]) |
21 ]); | 18 ]); |
22 }); | 19 }); |
23 | 20 |
24 schedulePub(args: ["global", "activate", "foo"]); | 21 schedulePub(args: ["global", "activate", "foo"]); |
25 | 22 |
26 d.dir(cachePath, [ | 23 var pub = pubRun(global: true, args: ["--checked", "foo:script"]); |
27 d.dir('bin', [ | 24 pub.stderr.expect(consumeThrough(contains( |
28 d.file(binStubName('script'), 'junk') | 25 "'bool' is not a subtype of type 'int' of 'a'"))); |
29 ]) | 26 pub.shouldExit(255); |
30 ]).create(); | |
31 | |
32 schedulePub(args: ["cache", "repair"], | |
33 error: contains('Error reading binstub for "script":')); | |
34 }); | 27 }); |
35 } | 28 } |
OLD | NEW |