| OLD | NEW |
| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 } | 58 } |
| 59 | 59 |
| 60 Iterable<CollectedMessage> get infos { | 60 Iterable<CollectedMessage> get infos { |
| 61 return filterMessagesByKinds([Diagnostic.INFO]); | 61 return filterMessagesByKinds([Diagnostic.INFO]); |
| 62 } | 62 } |
| 63 | 63 |
| 64 Iterable<CollectedMessage> get crashes { | 64 Iterable<CollectedMessage> get crashes { |
| 65 return filterMessagesByKinds([Diagnostic.CRASH]); | 65 return filterMessagesByKinds([Diagnostic.CRASH]); |
| 66 } | 66 } |
| 67 | 67 |
| 68 Iterable<CollectedMessage> get verboseInfos { |
| 69 return filterMessagesByKinds([Diagnostic.VERBOSE_INFO]); |
| 70 } |
| 71 |
| 68 /// `true` if non-verbose messages has been collected. | 72 /// `true` if non-verbose messages has been collected. |
| 69 bool get hasRegularMessages { | 73 bool get hasRegularMessages { |
| 70 return messages.any((m) => m.kind != Diagnostic.VERBOSE_INFO); | 74 return messages.any((m) => m.kind != Diagnostic.VERBOSE_INFO); |
| 71 } | 75 } |
| 72 | 76 |
| 73 void clear() { | 77 void clear() { |
| 74 messages.clear(); | 78 messages.clear(); |
| 75 } | 79 } |
| 76 | 80 |
| 77 void checkMessages(List<Expected> expectedMessages) { | 81 void checkMessages(List<Expected> expectedMessages) { |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 String expectedValue = '${arguments[key]}'; | 178 String expectedValue = '${arguments[key]}'; |
| 175 String foundValue = '${message.arguments[key]}'; | 179 String foundValue = '${message.arguments[key]}'; |
| 176 if (expectedValue != foundValue) { | 180 if (expectedValue != foundValue) { |
| 177 return 'Expected argument $key with value $expectedValue, ' | 181 return 'Expected argument $key with value $expectedValue, ' |
| 178 'found $foundValue.'; | 182 'found $foundValue.'; |
| 179 } | 183 } |
| 180 } | 184 } |
| 181 return null; | 185 return null; |
| 182 }; | 186 }; |
| 183 } | 187 } |
| OLD | NEW |