Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(544)

Side by Side Diff: sdk/lib/_internal/pub_generated/test/global/activate/outdated_binstub_test.dart

Issue 896623005: Use native async/await support in pub. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 import 'dart:io';
6 import 'dart:async';
7
8 import 'package:path/path.dart' as p;
9 import 'package:scheduled_test/scheduled_process.dart';
10 import 'package:scheduled_test/scheduled_stream.dart';
11 import 'package:scheduled_test/scheduled_test.dart';
12
13 import '../../descriptor.dart' as d;
14 import '../../test_pub.dart';
15
16 const _OUTDATED_BINSTUB = """
17 #!/usr/bin/env sh
18 # This file was created by pub v0.1.2-3.
19 # Package: foo
20 # Version: 1.0.0
21 # Executable: foo-script
22 # Script: script
23 dart "/path/to/.pub-cache/global_packages/foo/bin/script.dart.snapshot" "\$@"
24 """;
25
26 main() {
27 initConfig();
28 integration("an outdated binstub is replaced", () {
29 servePackages((builder) {
30 builder.serve("foo", "1.0.0", pubspec: {
31 "executables": {
32 "foo-script": "script"
33 }
34 },
35 contents: [
36 d.dir("bin", [d.file("script.dart", "main(args) => print('ok \$arg s');")])]);
37 });
38
39 schedulePub(args: ["global", "activate", "foo"]);
40
41 d.dir(
42 cachePath,
43 [
44 d.dir('bin', [d.file(binStubName('foo-script'), _OUTDATED_BINSTUB)]) ]).create();
45
46 schedulePub(args: ["global", "activate", "foo"]);
47
48 d.dir(
49 cachePath,
50 [d.dir('bin', [// 255 is the VM's exit code upon seeing an out-of-date s napshot.
51 d.matcherFile(
52 binStubName('foo-script'),
53 contains("255"))])]).validate();
54 });
55 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698