-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This removes this --list option from dartfix and instead displays the list of fixes when the --help option is specified. Partially addresses #36875 Change-Id: Ibd8b124c2c20a752f7e661672eac8aa2e4483b26 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105002 Auto-Submit: Dan Rubel <danrubel@google.com> Reviewed-by: Devon Carew <devoncarew@google.com> Commit-Queue: Dan Rubel <danrubel@google.com>
- Loading branch information
Dan Rubel
authored and
commit-bot@chromium.org
committed
Jun 6, 2019
1 parent
2e7501b
commit ba8e5f6
Showing
6 changed files
with
94 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file | ||
// 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 'package:dartfix/src/driver.dart'; | ||
import 'package:dartfix/src/options.dart'; | ||
import 'package:test/test.dart'; | ||
|
||
import 'test_context.dart'; | ||
|
||
main() { | ||
test('help explicit', () async { | ||
final driver = new Driver(); | ||
final testContext = new TestContext(); | ||
final testLogger = new TestLogger(); | ||
try { | ||
await driver.start( | ||
['--help'], // display help and list fixes | ||
testContext: testContext, | ||
testLogger: testLogger, | ||
); | ||
fail('expected exception'); | ||
} on TestExit catch (e) { | ||
expect(e.code, 1); | ||
} | ||
final errText = testLogger.stderrBuffer.toString(); | ||
final outText = testLogger.stdoutBuffer.toString(); | ||
expect(errText, contains('--$excludeOption')); | ||
expect(errText, isNot(contains('Use --help to display the fixes'))); | ||
expect(outText, contains('use-mixin')); | ||
}); | ||
|
||
test('help implicit', () async { | ||
final driver = new Driver(); | ||
final testContext = new TestContext(); | ||
final testLogger = new TestLogger(); | ||
try { | ||
await driver.start( | ||
[], // no options or arguments should display help and list fixes | ||
testContext: testContext, | ||
testLogger: testLogger, | ||
); | ||
fail('expected exception'); | ||
} on TestExit catch (e) { | ||
expect(e.code, 1); | ||
} | ||
final errText = testLogger.stderrBuffer.toString(); | ||
final outText = testLogger.stdoutBuffer.toString(); | ||
print(errText); | ||
print(outText); | ||
expect(errText, contains('--$excludeOption')); | ||
expect(errText, isNot(contains('Use --help to display the fixes'))); | ||
expect(outText, contains('use-mixin')); | ||
}); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters