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

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: Don't call function that does not exist. 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 1f535c1ddab7397fc57365f7482666964d4f3b0c..467b171a17553b26e2003e458e371154ba5c137e 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 = @'''
@@ -89,3 +91,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