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

Side by Side Diff: pkg/analyzer_cli/test/super_mixin_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/strong_mode_test.dart ('k') | pkg/analyzer_cli/test/utils.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.super_mixin;
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 'utils.dart';
15
16 /// End-to-end test for --supermixins.
17 ///
18 /// Most super mixin tests are in Analyzer, but this verifies the option is
19 /// working and producing extra errors as expected.
20 ///
21 /// Generally we don't want a lot of cases here as it requires spinning up a
22 /// full analysis context.
23 void main() {
24 group('--supermixins', () {
25 StringSink savedOutSink, savedErrorSink;
26 int savedExitCode;
27 setUp(() {
28 savedOutSink = outSink;
29 savedErrorSink = errorSink;
30 savedExitCode = exitCode;
31 outSink = new StringBuffer();
32 errorSink = new StringBuffer();
33 });
34 tearDown(() {
35 outSink = savedOutSink;
36 errorSink = savedErrorSink;
37 exitCode = savedExitCode;
38 });
39
40 test('produces errors when option absent', () async {
41 var testPath = path.join(testDirectory, 'data/super_mixin_example.dart');
42 new Driver().start([testPath]);
43
44 expect(exitCode, 3);
45 var stdout = outSink.toString();
46 expect(
47 stdout,
48 contains(
49 "[error] The class 'C' cannot be used as a mixin because it extend s a class other than Object"));
50 expect(
51 stdout,
52 contains(
53 "[error] The class 'C' cannot be used as a mixin because it refere nces 'super'"));
54 expect(stdout, contains('2 errors found.'));
55 expect(errorSink.toString(), '');
56 });
57
58 test('produces no errors when option present', () async {
59 var testPath = path.join(testDirectory, 'data/super_mixin_example.dart');
60 new Driver().start(['--supermixin', testPath]);
61
62 expect(exitCode, 0);
63 var stdout = outSink.toString();
64 expect(stdout, contains('No issues found'));
65 });
66 });
67 }
OLDNEW
« no previous file with comments | « pkg/analyzer_cli/test/strong_mode_test.dart ('k') | pkg/analyzer_cli/test/utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698