Index: pkg/analyzer_cli/test/errors_upgrade_fails_cli_test.dart |
diff --git a/pkg/analyzer_cli/test/errors_upgrade_fails_cli_test.dart b/pkg/analyzer_cli/test/errors_upgrade_fails_cli_test.dart |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2a035a37939867a9446f469f4f61740e3162484b |
--- /dev/null |
+++ b/pkg/analyzer_cli/test/errors_upgrade_fails_cli_test.dart |
@@ -0,0 +1,50 @@ |
+// Copyright (c) 2017, 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 'dart:io'; |
+ |
+import 'package:analyzer_cli/src/driver.dart'; |
+import 'package:analyzer_cli/src/options.dart'; |
+import 'package:path/path.dart' as path; |
+import 'package:test/test.dart'; |
+import 'package:test_reflective_loader/test_reflective_loader.dart'; |
+ |
+import 'utils.dart'; |
+ |
+main() { |
+ defineReflectiveTests(ErrorUpgradeFailsCli); |
+} |
+ |
+@reflectiveTest |
+class ErrorUpgradeFailsCli { |
+ StringSink savedOutSink, savedErrorSink; |
+ int savedExitCode; |
+ ExitHandler savedExitHandler; |
+ |
+ void setUp() { |
+ savedOutSink = outSink; |
+ savedErrorSink = errorSink; |
+ savedExitHandler = exitHandler; |
+ savedExitCode = exitCode; |
+ exitHandler = (code) => exitCode = code; |
+ outSink = new StringBuffer(); |
+ errorSink = new StringBuffer(); |
+ } |
+ |
+ void tearDown() { |
+ outSink = savedOutSink; |
+ errorSink = savedErrorSink; |
+ exitCode = savedExitCode; |
+ exitHandler = savedExitHandler; |
+ } |
+ |
+ test_once() async { |
+ String testDir = |
+ path.join(testDirectory, 'data', 'error_upgrade_fails_cli'); |
+ Driver driver = new Driver(); |
+ await driver.start([path.join(testDir, 'foo.dart')]); |
+ |
+ expect(exitCode, 3); |
+ } |
+} |