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

Side by Side Diff: tests/compiler/dart2js/diagnostic_helper.dart

Issue 2944843002: All strong mode cleaning of dart2js. (Closed)
Patch Set: More issues discovered during testing. Created 3 years, 6 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
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 dart2js.test.diagnostic_helper; 5 library dart2js.test.diagnostic_helper;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:compiler/compiler_new.dart' 9 import 'package:compiler/compiler_new.dart'
10 show CompilerDiagnostics, Diagnostic; 10 show CompilerDiagnostics, Diagnostic;
(...skipping 17 matching lines...) Expand all
28 String toString() { 28 String toString() {
29 return '${message != null ? message.kind : ''}' 29 return '${message != null ? message.kind : ''}'
30 ':$uri:$begin:$end:$text:$kind'; 30 ':$uri:$begin:$end:$text:$kind';
31 } 31 }
32 } 32 }
33 33
34 class DiagnosticCollector implements CompilerDiagnostics { 34 class DiagnosticCollector implements CompilerDiagnostics {
35 List<CollectedMessage> messages = <CollectedMessage>[]; 35 List<CollectedMessage> messages = <CollectedMessage>[];
36 36
37 @override 37 @override
38 void report(Message message, Uri uri, int begin, int end, String text, 38 void report(covariant Message message, Uri uri, int begin, int end,
39 Diagnostic kind) { 39 String text, Diagnostic kind) {
40 messages.add(new CollectedMessage(message, uri, begin, end, text, kind)); 40 messages.add(new CollectedMessage(message, uri, begin, end, text, kind));
41 } 41 }
42 42
43 Iterable<CollectedMessage> filterMessagesByKinds(List<Diagnostic> kinds) { 43 Iterable<CollectedMessage> filterMessagesByKinds(List<Diagnostic> kinds) {
44 return messages 44 return messages
45 .where((CollectedMessage message) => kinds.contains(message.kind)); 45 .where((CollectedMessage message) => kinds.contains(message.kind));
46 } 46 }
47 47
48 Iterable<CollectedMessage> get errors { 48 Iterable<CollectedMessage> get errors {
49 return filterMessagesByKinds([Diagnostic.ERROR]); 49 return filterMessagesByKinds([Diagnostic.ERROR]);
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 String expectedValue = '${arguments[key]}'; 178 String expectedValue = '${arguments[key]}';
179 String foundValue = '${message.arguments[key]}'; 179 String foundValue = '${message.arguments[key]}';
180 if (expectedValue != foundValue) { 180 if (expectedValue != foundValue) {
181 return 'Expected argument $key with value $expectedValue, ' 181 return 'Expected argument $key with value $expectedValue, '
182 'found $foundValue.'; 182 'found $foundValue.';
183 } 183 }
184 } 184 }
185 return null; 185 return null;
186 }; 186 };
187 } 187 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/deferred_not_in_main_test.dart ('k') | tests/compiler/dart2js/diagnostic_reporter_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698