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

Unified Diff: packages/args/test/utils.dart

Issue 2989763002: Update charted to 0.4.8 and roll (Closed)
Patch Set: Removed Cutch from list of reviewers Created 3 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « packages/args/test/usage_test.dart ('k') | packages/async/.analysis_options » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/args/test/utils.dart
diff --git a/packages/args/test/utils.dart b/packages/args/test/utils.dart
index 1cdd803ab3c263ef019d80344d239dc71f96d50e..a874eeec1cdc70bc18114e45b3b30738dc4db8b5 100644
--- a/packages/args/test/utils.dart
+++ b/packages/args/test/utils.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-library utils;
-
import 'dart:async';
import 'package:args/args.dart';
@@ -11,7 +9,7 @@ import 'package:args/command_runner.dart';
import 'package:test/test.dart';
class CommandRunnerWithFooter extends CommandRunner {
- final usageFooter = "Also, footer!";
+ String get usageFooter => "Also, footer!";
CommandRunnerWithFooter(String executableName, String description)
: super(executableName, description);
@@ -29,6 +27,38 @@ class FooCommand extends Command {
}
}
+class ValueCommand extends Command<int> {
+ final name = "foo";
+ final description = "Return a value.";
+ final takesArguments = false;
+
+ int run() => 12;
+}
+
+class AsyncValueCommand extends Command<String> {
+ final name = "foo";
+ final description = "Return a future.";
+ final takesArguments = false;
+
+ Future<String> run() async => "hi";
+}
+
+class MultilineCommand extends Command {
+ var hasRun = false;
+
+ final name = "multiline";
+ final description = "Multi\nline.";
+ final takesArguments = false;
+
+ void run() {
+ hasRun = true;
+ }
+}
+
+class MultilineSummaryCommand extends MultilineCommand {
+ String get summary => description;
+}
+
class HiddenCommand extends Command {
var hasRun = false;
@@ -73,7 +103,7 @@ void throwsFormat(ArgParser parser, List<String> args) {
expect(() => parser.parse(args), throwsFormatException);
}
-Matcher throwsUsageError(message, usage) {
+Matcher throwsUsageException(message, usage) {
return throwsA(predicate((error) {
expect(error, new isInstanceOf<UsageException>());
expect(error.message, message);
« no previous file with comments | « packages/args/test/usage_test.dart ('k') | packages/async/.analysis_options » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698