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

Unified Diff: frog/tests/leg/src/mock_compiler.dart

Issue 8974014: Resolve initializers in constructors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address 2nd round of comments. Created 9 years 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 side-by-side diff with in-line comments
Download patch
Index: frog/tests/leg/src/mock_compiler.dart
diff --git a/frog/tests/leg/src/mock_compiler.dart b/frog/tests/leg/src/mock_compiler.dart
index e7b2189f6529e5ec04f42b1c5aafb56f9306d951..354985fca0c4f2bec998aab1641d1e6a8f2c4a33 100644
--- a/frog/tests/leg/src/mock_compiler.dart
+++ b/frog/tests/leg/src/mock_compiler.dart
@@ -14,6 +14,8 @@ class WarningMessage {
Node node;
Message message;
WarningMessage(this.node, this.message);
+
+ toString() => message.toString();
}
final String DEFAULT_CORELIB = @'''
@@ -95,3 +97,23 @@ class MockCompiler extends Compiler {
}
}
+void compareWarningKinds(String text, expectedWarnings, foundWarnings) {
+ var fail = (message) => Expect.fail('$text: $message');
+ Iterator<MessageKind> expected = expectedWarnings.iterator();
+ Iterator<WarningMessage> found = foundWarnings.iterator();
+ while (expected.hasNext() && found.hasNext()) {
+ Expect.equals(expected.next(), found.next().message.kind);
+ }
+ if (expected.hasNext()) {
+ do {
+ print('Expected warning "${expected.next()}" did not occur');
+ } while (expected.hasNext());
+ fail('Too few warnings');
+ }
+ if (found.hasNext()) {
+ do {
+ print('Additional warning "${found.next()}"');
+ } while (found.hasNext());
+ fail('Too many warnings');
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698