Roll dart_style 2.0.3 into the SDK.

Change-Id: I3eb1ecf0fc4f3e82a3e2ebcbec7416565e5b2b2e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207502
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
This commit is contained in:
Robert Nystrom 2021-07-20 20:52:50 +00:00 committed by commit-bot@chromium.org
parent 4a02a33538
commit 7f2ed4749b
2 changed files with 14 additions and 1 deletions

2
DEPS
View file

@ -103,7 +103,7 @@ vars = {
# and land the review.
#
# For more details, see https://github.com/dart-lang/sdk/issues/30164
"dart_style_rev": "9d9dff90d9a2e0793ad2f795f36c2777f720eda0",
"dart_style_rev": "06bfd19593ed84dd288f67e02c6a753e6516288a",
"dartdoc_rev" : "c9621b92c738ec21a348cc2de032858276e9c774",
"devtools_rev" : "64cffbed6366329ad05e44d48fa2298367643bb6",

View file

@ -2,6 +2,7 @@
// 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.
import 'dart:convert';
import 'dart:io';
import 'package:test/test.dart';
@ -98,4 +99,16 @@ void format() {
startsWith('No file or directory found at "$unknownFilePath".'));
expect(result.stdout, startsWith('Formatted no files in '));
});
test('formats from stdin and exits', () async {
p = project(mainSrc: 'int get foo => 1;\n');
var process = await p.start(['format']);
process.stdin.writeln('main( ) { }');
var result = process.stdout.reduce((a, b) => a + b);
await process.stdin.close();
expect(await process.exitCode, 0);
expect(utf8.decode(await result), 'main() {}\n');
});
}