| 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 import 'package:scheduled_test/scheduled_test.dart'; |
| 6 |
| 5 import '../../descriptor.dart' as d; | 7 import '../../descriptor.dart' as d; |
| 6 import '../../test_pub.dart'; | 8 import '../../test_pub.dart'; |
| 7 | 9 |
| 10 const SCRIPT = """ |
| 8 main() { | 11 main() { |
| 9 integration('runs a script in an activated package', () { | 12 int a = true; |
| 13 print("no checks"); |
| 14 } |
| 15 """; |
| 16 |
| 17 main() { |
| 18 integration('runs a script in unchecked mode by default', () { |
| 10 servePackages((builder) { | 19 servePackages((builder) { |
| 11 builder.serve("foo", "1.0.0", contents: [ | 20 builder.serve("foo", "1.0.0", contents: [ |
| 12 d.dir("bin", [ | 21 d.dir("bin", [ |
| 13 d.file("script.dart", "main(args) => print('ok');") | 22 d.file("script.dart", SCRIPT) |
| 14 ]) | 23 ]) |
| 15 ]); | 24 ]); |
| 16 }); | 25 }); |
| 17 | 26 |
| 18 schedulePub(args: ["global", "activate", "foo"]); | 27 schedulePub(args: ["global", "activate", "foo"]); |
| 19 | 28 |
| 20 var pub = pubRun(global: true, args: ["foo:script"]); | 29 var pub = pubRun(global: true, args: ["foo:script"]); |
| 21 pub.stdout.expect("ok"); | 30 pub.stdout.expect("no checks"); |
| 22 pub.shouldExit(); | 31 pub.shouldExit(); |
| 23 }); | 32 }); |
| 24 } | 33 } |
| OLD | NEW |