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

Unified Diff: runtime/observatory/tests/service/command_test.dart

Issue 2751423005: Run dartfmt on all files under runtime. (Closed)
Patch Set: Run dartfmt on all files under runtime. Created 3 years, 9 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
Index: runtime/observatory/tests/service/command_test.dart
diff --git a/runtime/observatory/tests/service/command_test.dart b/runtime/observatory/tests/service/command_test.dart
index 90f9d6730e9e8cd8e910fc6bf210c7bcff30881f..bf90f07c7cb7e9ddfead9d2f5d489ef4ef76a2a1 100644
--- a/runtime/observatory/tests/service/command_test.dart
+++ b/runtime/observatory/tests/service/command_test.dart
@@ -35,20 +35,20 @@ class TestCompleteCommand extends Command {
}
void testCommandComplete() {
- RootCommand cmd =
- new RootCommand([new TestCommand(null, 'alpha', []),
-
- new TestCommand(null, 'game', [
- new TestCommand(null, 'checkers', []),
- new TestCommand(null, 'chess', [])]),
-
- new TestCommand(null, 'gamera', [
- new TestCommand(null, 'london', []),
- new TestCommand(null, 'tokyo', []),
- new TestCommand(null, 'topeka', [])]),
-
- new TestCompleteCommand(null, 'count', [
- new TestCommand(null, 'chocula', [])])]);
+ RootCommand cmd = new RootCommand([
+ new TestCommand(null, 'alpha', []),
+ new TestCommand(null, 'game', [
+ new TestCommand(null, 'checkers', []),
+ new TestCommand(null, 'chess', [])
+ ]),
+ new TestCommand(null, 'gamera', [
+ new TestCommand(null, 'london', []),
+ new TestCommand(null, 'tokyo', []),
+ new TestCommand(null, 'topeka', [])
+ ]),
+ new TestCompleteCommand(
+ null, 'count', [new TestCommand(null, 'chocula', [])])
+ ]);
// Show all commands.
cmd.completeCommand('').then((result) {
@@ -82,7 +82,8 @@ void testCommandComplete() {
// Show all subcommands.
cmd.completeCommand('gamera ').then((result) {
- expect(result, equals(['gamera london ', 'gamera tokyo ', 'gamera topeka ']));
+ expect(
+ result, equals(['gamera london ', 'gamera tokyo ', 'gamera topeka ']));
});
// Subcommand completion.
@@ -118,10 +119,8 @@ void testCommandComplete() {
// Locals + subcommands, show all.
cmd.completeCommand('count ').then((result) {
- expect(result, equals(['count chocula ',
- 'count one ',
- 'count two ',
- 'count three ']));
+ expect(result,
+ equals(['count chocula ', 'count one ', 'count two ', 'count three ']));
});
// Locals + subcommands, single local match.
@@ -152,30 +151,29 @@ void testCommandRunSimple() {
// Full name dispatch works. Argument passing works.
cmd.runCommand('alpha dog').then(expectAsync((_) {
- expect(out.toString(), contains('executing alpha([dog])\n'));
- out.clear();
- // Substring dispatch works.
- cmd.runCommand('al cat mouse').then(expectAsync((_) {
- expect(out.toString(), contains('executing alpha([cat , mouse])\n'));
- }));
+ expect(out.toString(), contains('executing alpha([dog])\n'));
+ out.clear();
+ // Substring dispatch works.
+ cmd.runCommand('al cat mouse').then(expectAsync((_) {
+ expect(out.toString(), contains('executing alpha([cat , mouse])\n'));
+ }));
}));
}
void testCommandRunSubcommand() {
// Run a simple command.
StringBuffer out = new StringBuffer();
- RootCommand cmd =
- new RootCommand([
- new TestCommand(out, 'alpha', [
- new TestCommand(out, 'beta', []),
- new TestCommand(out, 'gamma', [])])]);
+ RootCommand cmd = new RootCommand([
+ new TestCommand(out, 'alpha',
+ [new TestCommand(out, 'beta', []), new TestCommand(out, 'gamma', [])])
+ ]);
cmd.runCommand('a b').then(expectAsync((_) {
- expect(out.toString(), equals('executing beta([])\n'));
- out.clear();
- cmd.runCommand('alpha g ').then(expectAsync((_) {
- expect(out.toString(), equals('executing gamma([])\n'));
- }));
+ expect(out.toString(), equals('executing beta([])\n'));
+ out.clear();
+ cmd.runCommand('alpha g ').then(expectAsync((_) {
+ expect(out.toString(), equals('executing gamma([])\n'));
+ }));
}));
}
@@ -192,16 +190,15 @@ void testCommandRunNotFound() {
void testCommandRunAmbiguous() {
// Run a simple command.
StringBuffer out = new StringBuffer();
- RootCommand cmd = new RootCommand([new TestCommand(out, 'alpha', []),
- new TestCommand(out, 'ankle', [])]);
+ RootCommand cmd = new RootCommand(
+ [new TestCommand(out, 'alpha', []), new TestCommand(out, 'ankle', [])]);
cmd.runCommand('a 55').catchError(expectAsync((e) {
- expect(e.toString(),
- equals("Command 'a 55' is ambiguous: [alpha, ankle]"));
- out.clear();
- cmd.runCommand('ankl 55').then(expectAsync((_) {
- expect(out.toString(), equals('executing ankle([55])\n'));
- }));
+ expect(e.toString(), equals("Command 'a 55' is ambiguous: [alpha, ankle]"));
+ out.clear();
+ cmd.runCommand('ankl 55').then(expectAsync((_) {
+ expect(out.toString(), equals('executing ankle([55])\n'));
+ }));
}));
}
@@ -210,8 +207,8 @@ void testCommandRunAlias() {
StringBuffer out = new StringBuffer();
var aliasCmd = new TestCommand(out, 'alpha', []);
aliasCmd.alias = 'a';
- RootCommand cmd = new RootCommand([aliasCmd,
- new TestCommand(out, 'ankle', [])]);
+ RootCommand cmd =
+ new RootCommand([aliasCmd, new TestCommand(out, 'ankle', [])]);
cmd.runCommand('a 55').then(expectAsync((_) {
expect(out.toString(), equals('executing alpha([55])\n'));
@@ -226,4 +223,3 @@ main() {
test('run a command which is ambiguous', testCommandRunAmbiguous);
test('run a command using an alias', testCommandRunAlias);
}
-
« no previous file with comments | « runtime/observatory/tests/service/code_test.dart ('k') | runtime/observatory/tests/service/complex_reload/v1/main.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698