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

Unified Diff: pkg/analyzer/test/generated/test_support.dart

Issue 134533007: New analyzer snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 11 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
« no previous file with comments | « pkg/analyzer/test/generated/scanner_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/generated/test_support.dart
diff --git a/pkg/analyzer/test/generated/test_support.dart b/pkg/analyzer/test/generated/test_support.dart
index 8186ce4ce1d1875e7f891c85ec5c4812ad93d52f..d0d236807e3e98322008f846b9de13d550181d64 100644
--- a/pkg/analyzer/test/generated/test_support.dart
+++ b/pkg/analyzer/test/generated/test_support.dart
@@ -421,6 +421,22 @@ class EngineTestCase extends JUnitTestCase {
}
/**
+ * Assert that the given collection is non-`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 `null` or does not have the expected number
+ * of elements
+ */
+ static void assertCollectionSize(int expectedSize, Iterable c) {
+ if (c == null) {
+ JUnitTestCase.fail("Expected collection of size ${expectedSize}; found null");
+ } else if (c.length != expectedSize) {
+ JUnitTestCase.fail("Expected collection of size ${expectedSize}; contained ${c.length} elements");
+ }
+ }
+
+ /**
* Assert that the given array is non-`null` and contains the expected elements. The
* elements can appear in any order.
*
@@ -585,7 +601,7 @@ class EngineTestCase extends JUnitTestCase {
if (!isInstanceOf(object, expectedClass)) {
JUnitTestCase.fail("Expected instance of ${expectedClass.toString()}, found ${(object == null ? "null" : object.runtimeType.toString())}");
}
- return object as Object;
+ return object;
}
/**
@@ -616,26 +632,10 @@ class EngineTestCase extends JUnitTestCase {
JUnitTestCase.assertEquals(expectedToken.type, actualToken.type);
if (expectedToken is KeywordToken) {
assertInstanceOf(KeywordToken, actualToken);
- JUnitTestCase.assertEquals((expectedToken as KeywordToken).keyword, (actualToken as KeywordToken).keyword);
+ JUnitTestCase.assertEquals(expectedToken.keyword, (actualToken as KeywordToken).keyword);
} else if (expectedToken is StringToken) {
assertInstanceOf(StringToken, actualToken);
- JUnitTestCase.assertEquals((expectedToken as StringToken).lexeme, (actualToken as StringToken).lexeme);
- }
- }
-
- /**
- * Assert that the given collection is non-`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 `null` or does not have the expected number
- * of elements
- */
- static void assertCollectionSize(int expectedSize, Iterable c) {
- if (c == null) {
- JUnitTestCase.fail("Expected collection of size ${expectedSize}; found null");
- } else if (c.length != expectedSize) {
- JUnitTestCase.fail("Expected collection of size ${expectedSize}; contained ${c.length} elements");
+ JUnitTestCase.assertEquals(expectedToken.lexeme, (actualToken as StringToken).lexeme);
}
}
« no previous file with comments | « pkg/analyzer/test/generated/scanner_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698