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

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

Issue 2775073002: Fix analyzer tests when run in checked mode. (Closed)
Patch Set: Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | 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 library analyzer_cli.test.formatter; 5 library analyzer_cli.test.formatter;
6 6
7 import 'package:analyzer/analyzer.dart'; 7 import 'package:analyzer/analyzer.dart';
8 import 'package:analyzer_cli/src/ansi.dart' as ansi; 8 import 'package:analyzer_cli/src/ansi.dart' as ansi;
9 import 'package:analyzer_cli/src/error_formatter.dart'; 9 import 'package:analyzer_cli/src/error_formatter.dart';
10 import 'package:test/test.dart' hide ErrorFormatter; 10 import 'package:test/test.dart' hide ErrorFormatter;
(...skipping 15 matching lines...) Expand all
26 out.clear(); 26 out.clear();
27 ansi.runningTests = false; 27 ansi.runningTests = false;
28 }); 28 });
29 29
30 // Options 30 // Options
31 var options = new MockCommandLineOptions(); 31 var options = new MockCommandLineOptions();
32 when(options.enableTypeChecks).thenReturn(false); 32 when(options.enableTypeChecks).thenReturn(false);
33 when(options.hintsAreFatal).thenReturn(false); 33 when(options.hintsAreFatal).thenReturn(false);
34 when(options.machineFormat).thenReturn(false); 34 when(options.machineFormat).thenReturn(false);
35 when(options.verbose).thenReturn(false); 35 when(options.verbose).thenReturn(false);
36 when(options.color).thenReturn(false);
36 37
37 var reporter = new ErrorFormatter(out, options, stats); 38 var reporter = new ErrorFormatter(out, options, stats);
38 39
39 test('error', () { 40 test('error', () {
40 var error = mockError(ErrorType.SYNTACTIC_ERROR, ErrorSeverity.ERROR); 41 var error = mockError(ErrorType.SYNTACTIC_ERROR, ErrorSeverity.ERROR);
41 reporter.formatErrors([error]); 42 reporter.formatErrors([error]);
42 43
43 expect(out.toString().trim(), 44 expect(out.toString().trim(),
44 'error • MSG at /foo/bar/baz.dart:3:3 • mock_code'); 45 'error • MSG at /foo/bar/baz.dart:3:3 • mock_code');
45 }); 46 });
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 when(code.name).thenReturn('mock_code'); 83 when(code.name).thenReturn('mock_code');
83 when(error.errorCode).thenReturn(code); 84 when(error.errorCode).thenReturn(code);
84 when(error.message).thenReturn('MSG'); 85 when(error.message).thenReturn('MSG');
85 var source = new MockSource(); 86 var source = new MockSource();
86 when(source.fullName).thenReturn('/foo/bar/baz.dart'); 87 when(source.fullName).thenReturn('/foo/bar/baz.dart');
87 when(error.source).thenReturn(source); 88 when(error.source).thenReturn(source);
88 when(info.errors).thenReturn([error]); 89 when(info.errors).thenReturn([error]);
89 90
90 return info; 91 return info;
91 } 92 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698