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

Side by Side Diff: test/strong_mode_test.dart

Issue 1412293005: Defer to engine for option-aware context config. (Closed) Base URL: https://github.com/dart-lang/analyzer_cli.git@master
Patch Set: Created 5 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « test/driver_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 @TestOn("vm") 5 @TestOn("vm")
6
7 library analyzer_cli.test.strong_mode; 6 library analyzer_cli.test.strong_mode;
8 7
9 import 'dart:io'; 8 import 'dart:io';
10 9
11 import 'package:analyzer_cli/src/driver.dart' show Driver, errorSink, outSink; 10 import 'package:analyzer_cli/src/driver.dart' show Driver, errorSink, outSink;
12 import 'package:path/path.dart' as path; 11 import 'package:path/path.dart' as path;
13 import 'package:test/test.dart'; 12 import 'package:test/test.dart';
14 13
14 import 'driver_test.dart';
15 import 'utils.dart'; 15 import 'utils.dart';
16 16
17 /// End-to-end test for --strong checking. 17 /// End-to-end test for --strong checking.
18 /// 18 ///
19 /// Most strong mode tests are in Analyzer, but this verifies the option is 19 /// Most strong mode tests are in Analyzer, but this verifies the option is
20 /// working and producing extra errors as expected. 20 /// working and producing extra errors as expected.
21 /// 21 ///
22 /// Generally we don't want a lot of cases here as it requires spinning up a 22 /// Generally we don't want a lot of cases here as it requires spinning up a
23 /// full analysis context. 23 /// full analysis context.
24 void main() { 24 void main() {
25 group('--strong', () { 25 group('--strong', () {
26 StringSink savedOutSink, savedErrorSink; 26 StringSink savedOutSink, savedErrorSink;
27 int savedExitCode; 27 int savedExitCode;
28 setUp(() { 28 setUp(() {
29 savedOutSink = outSink; 29 savedOutSink = outSink;
30 savedErrorSink = errorSink; 30 savedErrorSink = errorSink;
31 savedExitCode = exitCode; 31 savedExitCode = exitCode;
32 outSink = new StringBuffer(); 32 outSink = new StringBuffer();
33 errorSink = new StringBuffer(); 33 errorSink = new StringBuffer();
34 }); 34 });
35 tearDown(() { 35 tearDown(() {
36 outSink = savedOutSink; 36 outSink = savedOutSink;
37 errorSink = savedErrorSink; 37 errorSink = savedErrorSink;
38 exitCode = savedExitCode; 38 exitCode = savedExitCode;
39 }); 39 });
40 40
41 test('produces stricter errors', () async { 41 test('produces stricter errors', () async {
42 var testPath = path.join(testDirectory, 'data/strong_example.dart'); 42 var testPath = path.join(testDirectory, 'data/strong_example.dart');
43 new Driver().start(['--strong', testPath]); 43 new Driver().start(['--options', emptyOptionsFile, '--strong', testPath]);
44 44
45 expect(exitCode, 3); 45 expect(exitCode, 3);
46 var stdout = outSink.toString(); 46 var stdout = outSink.toString();
47 expect(stdout, contains('[error] Invalid override')); 47 expect(stdout, contains('[error] Invalid override'));
48 expect(stdout, contains('[error] Type check failed')); 48 expect(stdout, contains('[error] Type check failed'));
49 expect(stdout, contains('2 errors found.')); 49 expect(stdout, contains('2 errors found.'));
50 expect(errorSink.toString(), ''); 50 expect(errorSink.toString(), '');
51 }); 51 });
52 }); 52 });
53 } 53 }
OLDNEW
« no previous file with comments | « test/driver_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698