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

Side by Side Diff: sdk/lib/_internal/pub/test/pub_test.dart

Issue 228703006: Add “pub cache repair” to forcibly re-install previously cached packages. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Revise. Created 6 years, 8 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
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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; 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 '../lib/src/exit_codes.dart' as exit_codes; 9 import '../lib/src/exit_codes.dart' as exit_codes;
10 import 'test_pub.dart'; 10 import 'test_pub.dart';
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 integration('running pub with --help after a command with subcommands shows ' 86 integration('running pub with --help after a command with subcommands shows '
87 'command usage', () { 87 'command usage', () {
88 schedulePub(args: ['cache', '--help'], 88 schedulePub(args: ['cache', '--help'],
89 output: ''' 89 output: '''
90 Work with the system cache. 90 Work with the system cache.
91 91
92 Usage: pub cache <subcommand> 92 Usage: pub cache <subcommand>
93 -h, --help Print usage information for this command. 93 -h, --help Print usage information for this command.
94 94
95 Available subcommands: 95 Available subcommands:
96 add Install a package. 96 add Install a package.
97 repair Reinstall cached packages.
97 '''); 98 ''');
98 }); 99 });
99 100
100 101
101 integration('running pub with just --version displays version', () { 102 integration('running pub with just --version displays version', () {
102 schedulePub(args: ['--version'], output: VERSION_STRING); 103 schedulePub(args: ['--version'], output: VERSION_STRING);
103 }); 104 });
104 105
105 integration('an unknown command displays an error message', () { 106 integration('an unknown command displays an error message', () {
106 schedulePub(args: ['quylthulg'], 107 schedulePub(args: ['quylthulg'],
(...skipping 17 matching lines...) Expand all
124 125
125 integration('an unknown subcommand displays an error message', () { 126 integration('an unknown subcommand displays an error message', () {
126 schedulePub(args: ['cache', 'quylthulg'], 127 schedulePub(args: ['cache', 'quylthulg'],
127 error: ''' 128 error: '''
128 Could not find a subcommand named "quylthulg" for "pub cache". 129 Could not find a subcommand named "quylthulg" for "pub cache".
129 130
130 Usage: pub cache <subcommand> 131 Usage: pub cache <subcommand>
131 -h, --help Print usage information for this command. 132 -h, --help Print usage information for this command.
132 133
133 Available subcommands: 134 Available subcommands:
134 add Install a package. 135 add Install a package.
136 repair Reinstall cached packages.
135 ''', 137 ''',
136 exitCode: exit_codes.USAGE); 138 exitCode: exit_codes.USAGE);
137 }); 139 });
138 140
139 integration('an unknown option displays an error message', () { 141 integration('an unknown option displays an error message', () {
140 schedulePub(args: ['--blorf'], 142 schedulePub(args: ['--blorf'],
141 error: ''' 143 error: '''
142 Could not find an option named "blorf". 144 Could not find an option named "blorf".
143 Run "pub help" to see available options. 145 Run "pub help" to see available options.
144 ''', 146 ''',
(...skipping 24 matching lines...) Expand all
169 171
170 integration('a missing subcommand displays an error message', () { 172 integration('a missing subcommand displays an error message', () {
171 schedulePub(args: ['cache'], 173 schedulePub(args: ['cache'],
172 error: ''' 174 error: '''
173 Missing subcommand for "pub cache". 175 Missing subcommand for "pub cache".
174 176
175 Usage: pub cache <subcommand> 177 Usage: pub cache <subcommand>
176 -h, --help Print usage information for this command. 178 -h, --help Print usage information for this command.
177 179
178 Available subcommands: 180 Available subcommands:
179 add Install a package. 181 add Install a package.
182 repair Reinstall cached packages.
180 ''', 183 ''',
181 exitCode: exit_codes.USAGE); 184 exitCode: exit_codes.USAGE);
182 }); 185 });
183 186
184 group('help', () { 187 group('help', () {
185 integration('shows global help if no command is given', () { 188 integration('shows global help if no command is given', () {
186 schedulePub(args: ['help'], output: USAGE_STRING); 189 schedulePub(args: ['help'], output: USAGE_STRING);
187 }); 190 });
188 191
189 integration('shows help for a command', () { 192 integration('shows help for a command', () {
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 273
271 integration('an unknown help subcommand displays an error message', () { 274 integration('an unknown help subcommand displays an error message', () {
272 schedulePub(args: ['help', 'cache', 'quylthulg'], 275 schedulePub(args: ['help', 'cache', 'quylthulg'],
273 error: ''' 276 error: '''
274 Could not find a subcommand named "quylthulg" for "pub cache". 277 Could not find a subcommand named "quylthulg" for "pub cache".
275 278
276 Usage: pub cache <subcommand> 279 Usage: pub cache <subcommand>
277 -h, --help Print usage information for this command. 280 -h, --help Print usage information for this command.
278 281
279 Available subcommands: 282 Available subcommands:
280 add Install a package. 283 add Install a package.
284 repair Reinstall cached packages.
281 ''', 285 ''',
282 exitCode: exit_codes.USAGE); 286 exitCode: exit_codes.USAGE);
283 }); 287 });
284 288
285 integration('an unexpected help subcommand displays an error message', () { 289 integration('an unexpected help subcommand displays an error message', () {
286 schedulePub(args: ['help', 'version', 'badsubcommand'], 290 schedulePub(args: ['help', 'version', 'badsubcommand'],
287 error: ''' 291 error: '''
288 Command "pub version" does not expect a subcommand. 292 Command "pub version" does not expect a subcommand.
289 293
290 Usage: pub version 294 Usage: pub version
291 -h, --help Print usage information for this command. 295 -h, --help Print usage information for this command.
292 ''', 296 ''',
293 exitCode: exit_codes.USAGE); 297 exitCode: exit_codes.USAGE);
294 }); 298 });
295 }); 299 });
296 300
297 group('version', () { 301 group('version', () {
298 integration('displays the current version', () { 302 integration('displays the current version', () {
299 schedulePub(args: ['version'], output: VERSION_STRING); 303 schedulePub(args: ['version'], output: VERSION_STRING);
300 }); 304 });
301 }); 305 });
302 } 306 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698