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

Unified Diff: pkg/unittest/lib/src/core_matchers.dart

Issue 11365059: Temporarily reintroduce IndexOutOfRangeError matcher in unittests. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixed test expectations now that we are 100% backwards compatible. Created 8 years, 1 month 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 | « lib/core/errors.dart ('k') | tests/co19/co19-dart2dart.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/unittest/lib/src/core_matchers.dart
diff --git a/pkg/unittest/lib/src/core_matchers.dart b/pkg/unittest/lib/src/core_matchers.dart
index 586c8eb5202c62b07e52d9dcd82e44761c6af12d..9d0fb2adefa73919d04a6a044dca565c20701aa5 100644
--- a/pkg/unittest/lib/src/core_matchers.dart
+++ b/pkg/unittest/lib/src/core_matchers.dart
@@ -465,6 +465,19 @@ class _RangeError extends TypeMatcher {
bool matches(item, MatchState matchState) => item is RangeError;
}
+// Temporary matcher for deprecated IndexOutOfRangeException.
+/** A matcher for IndexOutOfRangeExceptions. */
+const isIndexOutOfRangeException = const _IndexOutOfRangeException();
+
+/** A matcher for functions that throw IndexOutOfRangeException. */
+const Matcher throwsIndexOutOfRangeException =
+ const Throws(isIndexOutOfRangeException);
+
+class _IndexOutOfRangeException extends TypeMatcher {
+ const _IndexOutOfRangeException() : super("IndexOutOfRangeException");
+ bool matches(item, MatchState matchState) => item is IndexOutOfRangeException;
+}
+
/** A matcher for NoSuchMethodErrors. */
const isNoSuchMethodError = const _NoSuchMethodError();
« no previous file with comments | « lib/core/errors.dart ('k') | tests/co19/co19-dart2dart.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698