diff --git a/DEPS b/DEPS index 3d15b954112..c3a41461149 100644 --- a/DEPS +++ b/DEPS @@ -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", diff --git a/pkg/dartdev/test/commands/format_test.dart b/pkg/dartdev/test/commands/format_test.dart index 82e68d2cfca..568f3ce73af 100644 --- a/pkg/dartdev/test/commands/format_test.dart +++ b/pkg/dartdev/test/commands/format_test.dart @@ -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'); + }); }