Reformat tests with the latest dartfmt
diff --git a/.travis.yml b/.travis.yml
index ac48a95..3b94716 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -9,7 +9,7 @@
matrix:
include:
- - dart: stable
+ - dart: dev
dart_task: dartfmt
# Only building master means that we don't run two builds for each pull request.
diff --git a/example/test_runner.dart b/example/test_runner.dart
index d9a6297..64f0fff 100644
--- a/example/test_runner.dart
+++ b/example/test_runner.dart
@@ -150,8 +150,7 @@
defaultsTo: false,
help: 'Keep the generated files in the temporary directory');
- parser.addOption('special-command',
- help: """
+ parser.addOption('special-command', help: """
Special command support. Wraps the command line in
a special command. The special command should contain
an '@' character which will be replaced by the normal
diff --git a/test/command_runner_test.dart b/test/command_runner_test.dart
index 5a765b1..ebb2f61 100644
--- a/test/command_runner_test.dart
+++ b/test/command_runner_test.dart
@@ -299,11 +299,8 @@
var command = new FooCommand();
runner.addCommand(command);
- expect(
- runner.run(["foo", "--asdf"]),
- throwsUsageException(
- 'Could not find an option named "asdf".',
- """
+ expect(runner.run(["foo", "--asdf"]),
+ throwsUsageException('Could not find an option named "asdf".', """
Usage: test foo [arguments]
-h, --help Print this usage information.
@@ -351,11 +348,8 @@
test("a subcommand doesn't exist", () {
runner.addCommand(new FooCommand()..addSubcommand(new AsyncCommand()));
- expect(
- runner.run(["foo bad"]),
- throwsUsageException(
- 'Could not find a command named "foo bad".',
- """
+ expect(runner.run(["foo bad"]),
+ throwsUsageException('Could not find a command named "foo bad".', """
Usage: test <command> [arguments]
Global options:
@@ -371,11 +365,8 @@
test("a subcommand wasn't passed", () {
runner.addCommand(new FooCommand()..addSubcommand(new AsyncCommand()));
- expect(
- runner.run(["foo"]),
- throwsUsageException(
- 'Missing subcommand for "test foo".',
- """
+ expect(runner.run(["foo"]),
+ throwsUsageException('Missing subcommand for "test foo".', """
Usage: test foo <subcommand> [arguments]
-h, --help Print this usage information.
@@ -388,11 +379,8 @@
test("a command that doesn't take arguments was given them", () {
runner.addCommand(new FooCommand());
- expect(
- runner.run(["foo", "bar"]),
- throwsUsageException(
- 'Command "foo" does not take any arguments.',
- """
+ expect(runner.run(["foo", "bar"]),
+ throwsUsageException('Command "foo" does not take any arguments.', """
Usage: test foo [arguments]
-h, --help Print this usage information.
diff --git a/test/command_test.dart b/test/command_test.dart
index c0c08d3..c4f29d4 100644
--- a/test/command_test.dart
+++ b/test/command_test.dart
@@ -91,10 +91,7 @@
test("usageException splits up the message and usage", () {
expect(
- () => foo.usageException("message"),
- throwsUsageException(
- "message",
- """
+ () => foo.usageException("message"), throwsUsageException("message", """
Usage: test foo [arguments]
-h, --help Print this usage information.
diff --git a/test/usage_test.dart b/test/usage_test.dart
index 6c591bf..cef3a16 100644
--- a/test/usage_test.dart
+++ b/test/usage_test.dart
@@ -11,9 +11,7 @@
var parser = new ArgParser();
parser.addFlag('mode', help: 'The mode');
- validateUsage(
- parser,
- '''
+ validateUsage(parser, '''
--[no-]mode The mode
''');
});
@@ -22,9 +20,7 @@
var parser = new ArgParser();
parser.addFlag('mode', negatable: false, help: 'The mode');
- validateUsage(
- parser,
- '''
+ validateUsage(parser, '''
--mode The mode
''');
});
@@ -33,9 +29,7 @@
var parser = new ArgParser();
parser.addFlag('mode', help: 'The mode');
- validateUsage(
- parser,
- '''
+ validateUsage(parser, '''
--[no-]mode The mode
''');
});
@@ -45,9 +39,7 @@
parser.addFlag('mode', abbr: 'm', help: 'The mode');
parser.addOption('long', help: 'Lacks an abbreviation');
- validateUsage(
- parser,
- '''
+ validateUsage(parser, '''
-m, --[no-]mode The mode
--long Lacks an abbreviation
''');
@@ -58,9 +50,7 @@
parser.addFlag('mode', abbr: 'm', help: 'Lined up with below');
parser.addOption('a-really-long-name', help: 'Its help text');
- validateUsage(
- parser,
- '''
+ validateUsage(parser, '''
-m, --[no-]mode Lined up with below
--a-really-long-name Its help text
''');
@@ -70,9 +60,7 @@
var parser = new ArgParser();
parser.addFlag('mode', help: '\n\n\n\nAfter newlines');
- validateUsage(
- parser,
- '''
+ validateUsage(parser, '''
--[no-]mode After newlines
''');
});
@@ -81,9 +69,7 @@
var parser = new ArgParser();
parser.addFlag('mode', help: 'Before newlines\n\n\n\n');
- validateUsage(
- parser,
- '''
+ validateUsage(parser, '''
--[no-]mode Before newlines
''');
});
@@ -94,9 +80,7 @@
parser.addFlag('monkey', help: 'Second');
parser.addFlag('wombat', help: 'Third');
- validateUsage(
- parser,
- '''
+ validateUsage(parser, '''
--[no-]zebra First
--[no-]monkey Second
--[no-]wombat Third
@@ -108,9 +92,7 @@
parser.addFlag('affirm', help: 'Should be on', defaultsTo: true);
parser.addFlag('negate', help: 'Should be off', defaultsTo: false);
- validateUsage(
- parser,
- '''
+ validateUsage(parser, '''
--[no-]affirm Should be on
(defaults to on)
@@ -122,9 +104,7 @@
var parser = new ArgParser();
parser.addOption('any', help: 'Can be anything', defaultsTo: 'whatevs');
- validateUsage(
- parser,
- '''
+ validateUsage(parser, '''
--any Can be anything
(defaults to "whatevs")
''');
@@ -135,9 +115,7 @@
parser.addOption('out',
abbr: 'o', help: 'Where to write file', valueHelp: 'path');
- validateUsage(
- parser,
- '''
+ validateUsage(parser, '''
-o, --out=<path> Where to write file
''');
});
@@ -148,9 +126,7 @@
help: 'Like in cards',
allowed: ['spades', 'clubs', 'hearts', 'diamonds']);
- validateUsage(
- parser,
- '''
+ validateUsage(parser, '''
--suit Like in cards
[spades, clubs, hearts, diamonds]
''');
@@ -163,9 +139,7 @@
defaultsTo: 'clubs',
allowed: ['spades', 'clubs', 'hearts', 'diamonds']);
- validateUsage(
- parser,
- '''
+ validateUsage(parser, '''
--suit Like in cards
[spades, clubs (default), hearts, diamonds]
''');
@@ -189,9 +163,7 @@
'hearts': 'The shape of my heart'
});
- validateUsage(
- parser,
- '''
+ validateUsage(parser, '''
--suit Like in cards
[clubs] Weapons of war
@@ -207,9 +179,7 @@
parser.addOption('second', hide: true);
parser.addOption('third', help: 'The third option');
- validateUsage(
- parser,
- '''
+ validateUsage(parser, '''
--first The first option
--third The third option
''');
@@ -221,9 +191,7 @@
parser.addFlag('second', hide: true);
parser.addFlag('third', help: 'The third flag');
- validateUsage(
- parser,
- '''
+ validateUsage(parser, '''
--[no-]first The first flag
--[no-]third The third flag
''');
@@ -235,9 +203,7 @@
parser.addFlag('second-very-long-option', hide: true);
parser.addFlag('third', help: 'The third flag');
- validateUsage(
- parser,
- '''
+ validateUsage(parser, '''
--[no-]first The first flag
--[no-]third The third flag
''');
@@ -252,9 +218,7 @@
parser.addSeparator('Marsupial:');
parser.addFlag('wombat', help: 'Third');
- validateUsage(
- parser,
- '''
+ validateUsage(parser, '''
--[no-]zebra First
Primate:
@@ -271,9 +235,7 @@
parser.addSeparator('Primate:');
parser.addFlag('monkey', help: 'Second');
- validateUsage(
- parser,
- '''
+ validateUsage(parser, '''
--[no-]zebra Multi
line
@@ -287,9 +249,7 @@
parser.addSeparator('Equine:');
parser.addFlag('zebra', help: 'First');
- validateUsage(
- parser,
- '''
+ validateUsage(parser, '''
Equine:
--[no-]zebra First
''');
@@ -300,9 +260,7 @@
parser.addFlag('zebra', help: 'First');
parser.addSeparator('Primate:');
- validateUsage(
- parser,
- '''
+ validateUsage(parser, '''
--[no-]zebra First
Primate:
@@ -314,9 +272,7 @@
parser.addSeparator('First');
parser.addSeparator('Second');
- validateUsage(
- parser,
- '''
+ validateUsage(parser, '''
First
Second