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

Unified Diff: editor/util/plugins/com.google.dart.java2dart/resources/java_junit.dart

Issue 14308011: New Analysis Engine snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: editor/util/plugins/com.google.dart.java2dart/resources/java_junit.dart
diff --git a/editor/util/plugins/com.google.dart.java2dart/resources/java_junit.dart b/editor/util/plugins/com.google.dart.java2dart/resources/java_junit.dart
index 8d284eb9ce8d78f74c8428638ba07f4da8997ff2..2ff97ad419d23291b59a342290f9bb1094344160 100644
--- a/editor/util/plugins/com.google.dart.java2dart/resources/java_junit.dart
+++ b/editor/util/plugins/com.google.dart.java2dart/resources/java_junit.dart
@@ -28,6 +28,9 @@ class JUnitTestCase {
static void assertNotNull(x) {
expect(x, isNotNull);
}
+ static void assertNotNullMsg(String msg, x) {
+ expect(x, isNotNullMsg(msg));
+ }
static void assertEquals(expected, actual) {
expect(actual, equals(expected));
}
@@ -110,3 +113,19 @@ class _IsFalseWithMessage extends BaseMatcher {
return mismatchDescription.replace(msg).add(" $item is not false");
}
}
+
+Matcher isNotNullMsg(String msg) => new _IsNotNullWithMessage(msg);
+class _IsNotNullWithMessage extends BaseMatcher {
+ final String msg;
+ const _IsNotNullWithMessage(this.msg);
+ bool matches(item, MatchState matchState) {
+ return item != null;
+ }
+ Description describe(Description mismatchDescription) {
+ return mismatchDescription.replace(msg);
+ }
+ Description describeMismatch(item, Description mismatchDescription,
+ MatchState matchState, bool verbose) {
+ return mismatchDescription.replace(msg).add(" $item is null");
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698