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

Unified Diff: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/EngineTestCase.java

Issue 24481002: New analyzer_experimental snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/EngineTestCase.java
diff --git a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/EngineTestCase.java b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/EngineTestCase.java
index 82fcbb9517cbab8ed7621aee9ad77558b8c0fbe8..3e276d3d5c990d6087e7147b0bfc930a92c714e4 100644
--- a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/EngineTestCase.java
+++ b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/EngineTestCase.java
@@ -31,6 +31,7 @@ import junit.framework.Assert;
import junit.framework.AssertionFailedError;
import junit.framework.TestCase;
+import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -282,6 +283,22 @@ public class EngineTestCase extends TestCase {
}
/**
+ * Assert that the given collection is non-{@code null} and has the expected number of elements.
+ *
+ * @param expectedSize the expected number of elements
+ * @param c the collection being tested
+ * @throws AssertionFailedError if the list is {@code null} or does not have the expected number
+ * of elements
+ */
+ public static void assertCollectionSize(int expectedSize, Collection<?> c) {
+ if (c == null) {
+ fail("Expected collection of size " + expectedSize + "; found null");
+ } else if (c.size() != expectedSize) {
+ fail("Expected collection of size " + expectedSize + "; contained " + c.size() + " elements");
+ }
+ }
+
+ /**
* Assert that the given list is non-{@code null} and has the expected number of elements.
*
* @param expectedSize the expected number of elements

Powered by Google App Engine
This is Rietveld 408576698