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

Side by Side Diff: pkg/analyzer_cli/test/strong_mode_test.dart

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

Powered by Google App Engine
This is Rietveld 408576698