OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 'dart:convert'; | 5 import 'dart:convert'; |
6 import 'dart:io'; | 6 import 'dart:io'; |
7 import 'dart:math' as math; | 7 import 'dart:math' as math; |
8 | 8 |
9 import 'package:path/path.dart' as p; | 9 import 'package:path/path.dart' as p; |
| 10 import 'package:pub/src/exit_codes.dart' as exit_codes; |
10 import 'package:scheduled_test/scheduled_test.dart'; | 11 import 'package:scheduled_test/scheduled_test.dart'; |
11 import 'package:scheduled_test/scheduled_server.dart'; | 12 import 'package:scheduled_test/scheduled_server.dart'; |
12 import 'package:shelf/shelf.dart' as shelf; | 13 import 'package:shelf/shelf.dart' as shelf; |
13 | 14 |
14 import '../../lib/src/exit_codes.dart' as exit_codes; | |
15 import '../descriptor.dart' as d; | 15 import '../descriptor.dart' as d; |
16 import '../test_pub.dart'; | 16 import '../test_pub.dart'; |
17 import 'utils.dart'; | 17 import 'utils.dart'; |
18 | 18 |
19 /// The maximum number of bytes in an entire path. | 19 /// The maximum number of bytes in an entire path. |
20 /// | 20 /// |
21 /// This is [Windows's number][MAX_PATH], which is a much tighter constraint | 21 /// This is [Windows's number][MAX_PATH], which is a much tighter constraint |
22 /// than OS X or Linux. We subtract one because Windows counts it as the number | 22 /// than OS X or Linux. We subtract one because Windows counts it as the number |
23 /// of bytes in a path C string including the terminating NUL but we only count | 23 /// of bytes in a path C string including the terminating NUL but we only count |
24 /// characters here. | 24 /// characters here. |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 return new shelf.Response.ok(JSON.encode({ | 89 return new shelf.Response.ok(JSON.encode({ |
90 'success': {'message': 'Package test_pkg 1.0.0 uploaded!'} | 90 'success': {'message': 'Package test_pkg 1.0.0 uploaded!'} |
91 })); | 91 })); |
92 }); | 92 }); |
93 | 93 |
94 pub.stdout.expect(startsWith('Uploading...')); | 94 pub.stdout.expect(startsWith('Uploading...')); |
95 pub.stdout.expect('Package test_pkg 1.0.0 uploaded!'); | 95 pub.stdout.expect('Package test_pkg 1.0.0 uploaded!'); |
96 pub.shouldExit(exit_codes.SUCCESS); | 96 pub.shouldExit(exit_codes.SUCCESS); |
97 }); | 97 }); |
98 } | 98 } |
OLD | NEW |