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

Unified Diff: sdk/lib/_internal/pub/test/test_pub.dart

Issue 103453005: Show detailed report on upgrade. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Revise again. Created 7 years 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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/pub/test/test_pub.dart
diff --git a/sdk/lib/_internal/pub/test/test_pub.dart b/sdk/lib/_internal/pub/test/test_pub.dart
index 6eef80b912570f8599f62de7092353acab39f9bf..71ce02c8a3bb70e938aeb59eb2036a322f0f7786 100644
--- a/sdk/lib/_internal/pub/test/test_pub.dart
+++ b/sdk/lib/_internal/pub/test/test_pub.dart
@@ -263,13 +263,13 @@ bool _abortScheduled = false;
/// Enum identifying a pub command that can be run with a well-defined success
/// output.
class RunCommand {
- static final get = new RunCommand('get', 'Got dependencies!');
- static final upgrade = new RunCommand('upgrade', 'Dependencies upgraded!');
+ static final get = new RunCommand('get', new RegExp(r'Got dependencies!$'));
+ static final upgrade = new RunCommand('upgrade', new RegExp(
+ r'(No dependencies changed\.|Changed \d+ dependenc(y|ies)!)$'));
final String name;
final RegExp success;
- RunCommand(this.name, String message)
- : success = new RegExp("$message\$");
+ RunCommand(this.name, this.success);
}
/// Many tests validate behavior that is the same between pub get and
@@ -290,8 +290,8 @@ void forBothPubGetAndUpgrade(void callback(RunCommand command)) {
/// [warning] to stderr. If [error] is given, it expects the command to *only*
/// print [error] to stderr.
// TODO(rnystrom): Clean up other tests to call this when possible.
-void pubCommand(RunCommand command, {Iterable<String> args, Pattern error,
- Pattern warning}) {
+void pubCommand(RunCommand command,
+ {Iterable<String> args, Pattern output, Pattern error, Pattern warning}) {
if (error != null && warning != null) {
throw new ArgumentError("Cannot pass both 'error' and 'warning'.");
}
@@ -299,7 +299,7 @@ void pubCommand(RunCommand command, {Iterable<String> args, Pattern error,
var allArgs = [command.name];
if (args != null) allArgs.addAll(args);
- var output = command.success;
+ if (output == null) output = command.success;
var exitCode = null;
if (error != null) exitCode = 1;
@@ -316,9 +316,10 @@ void pubGet({Iterable<String> args, Pattern error,
pubCommand(RunCommand.get, args: args, error: error, warning: warning);
}
-void pubUpgrade({Iterable<String> args, Pattern error,
+void pubUpgrade({Iterable<String> args, Pattern output, Pattern error,
Pattern warning}) {
- pubCommand(RunCommand.upgrade, args: args, error: error, warning: warning);
+ pubCommand(RunCommand.upgrade, args: args, output: output, error: error,
+ warning: warning);
}
/// Defines an integration test. The [body] should schedule a series of

Powered by Google App Engine
This is Rietveld 408576698