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

Unified Diff: pkg/analyzer_cli/test/strong_mode_test.dart

Issue 2971343002: Fix strong_mode_test after moving driver_test fields into class. (Closed)
Patch Set: Rollback unrelated change in elements. Created 3 years, 5 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
« no previous file with comments | « pkg/analyzer_cli/test/driver_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer_cli/test/strong_mode_test.dart
diff --git a/pkg/analyzer_cli/test/strong_mode_test.dart b/pkg/analyzer_cli/test/strong_mode_test.dart
index 41928da22a93a6efa7c5ccfc957e32e4ac349e6d..a122e98a0a20c263e7889cfc30e482fd6a4329d7 100644
--- a/pkg/analyzer_cli/test/strong_mode_test.dart
+++ b/pkg/analyzer_cli/test/strong_mode_test.dart
@@ -6,12 +6,17 @@ library analyzer_cli.test.strong_mode;
import 'dart:io';
-import 'package:analyzer_cli/src/driver.dart' show Driver, errorSink, outSink;
-import 'package:path/path.dart' as path;
+import 'package:analyzer_cli/src/driver.dart' show outSink;
import 'package:test/test.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'driver_test.dart';
-import 'utils.dart';
+
+main() {
+ // TODO(pq): fix tests to run safely on the bots
+ // https://github.com/dart-lang/sdk/issues/25001
+// defineReflectiveTests(StrongModeTest);
+}
/// End-to-end test for --strong checking.
///
@@ -20,38 +25,15 @@ import 'utils.dart';
///
/// Generally we don't want a lot of cases here as it requires spinning up a
/// full analysis context.
-///
-// TODO(pq): fix tests to run safely on the bots
-// https://github.com/dart-lang/sdk/issues/25001
-main() {}
-not_main() {
- group('--strong', () {
- StringSink savedOutSink, savedErrorSink;
- int savedExitCode;
- setUp(() {
- savedOutSink = outSink;
- savedErrorSink = errorSink;
- savedExitCode = exitCode;
- outSink = new StringBuffer();
- errorSink = new StringBuffer();
- });
- tearDown(() {
- outSink = savedOutSink;
- errorSink = savedErrorSink;
- exitCode = savedExitCode;
- });
-
- test('produces stricter errors', () async {
- var testPath = path.join(testDirectory, 'data/strong_example.dart');
- new Driver(isTesting: true)
- .start(['--options', emptyOptionsFile, '--strong', testPath]);
+@reflectiveTest
+class StrongModeTest extends BaseTest {
+ test_producesStricterErrors() async {
+ await drive('data/strong_example.dart', args: ['--strong']);
- expect(exitCode, 3);
- var stdout = outSink.toString();
- expect(stdout, contains('[error] Invalid override'));
- expect(stdout, contains('[error] Type check failed'));
- expect(stdout, contains('2 errors found.'));
- expect(errorSink.toString(), '');
- });
- });
+ expect(exitCode, 3);
+ var stdout = bulletToDash(outSink);
+ expect(stdout, contains('error - Invalid override'));
+ expect(stdout, contains('error - The list literal type'));
+ expect(stdout, contains('2 errors found'));
+ }
}
« no previous file with comments | « pkg/analyzer_cli/test/driver_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698