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

Side by Side Diff: pkg/unittest/core_matchers.dart

Issue 11275042: Renaming IndexOutOfRangeException to RangeError. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: ADded RangeError.value constructor. Made VM calls work. 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of unittest; 5 part of unittest;
6 6
7 /** 7 /**
8 * Returns a matcher that matches empty strings, maps or collections. 8 * Returns a matcher that matches empty strings, maps or collections.
9 */ 9 */
10 const Matcher isEmpty = const _Empty(); 10 const Matcher isEmpty = const _Empty();
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 446
447 /** A matcher for functions that throw IllegalJSRegExpException. */ 447 /** A matcher for functions that throw IllegalJSRegExpException. */
448 const Matcher throwsIllegalJSRegExpException = 448 const Matcher throwsIllegalJSRegExpException =
449 const Throws(isIllegalJSRegExpException); 449 const Throws(isIllegalJSRegExpException);
450 450
451 class _IllegalJSRegExpException extends TypeMatcher { 451 class _IllegalJSRegExpException extends TypeMatcher {
452 const _IllegalJSRegExpException() : super("IllegalJSRegExpException"); 452 const _IllegalJSRegExpException() : super("IllegalJSRegExpException");
453 bool matches(item, MatchState matchState) => item is IllegalJSRegExpException; 453 bool matches(item, MatchState matchState) => item is IllegalJSRegExpException;
454 } 454 }
455 455
456 /** A matcher for IndexOutOfRangeExceptions. */ 456 /** A matcher for RangeErrors. */
457 const isIndexOutOfRangeException = const _IndexOutOfRangeException(); 457 const isRangeError = const _RangeError();
458 458
459 /** A matcher for functions that throw IndexOutOfRangeException. */ 459 /** A matcher for functions that throw RangeError */
460 const Matcher throwsIndexOutOfRangeException = 460 const Matcher throwsRangeError =
461 const Throws(isIndexOutOfRangeException); 461 const Throws(isRangeError);
462 462
463 class _IndexOutOfRangeException extends TypeMatcher { 463 class _RangeError extends TypeMatcher {
464 const _IndexOutOfRangeException() : super("IndexOutOfRangeException"); 464 const _RangeError() : super("RangeError");
465 bool matches(item, MatchState matchState) => item is IndexOutOfRangeException; 465 bool matches(item, MatchState matchState) => item is RangeError;
466 } 466 }
467 467
468 /** A matcher for NoSuchMethodErrors. */ 468 /** A matcher for NoSuchMethodErrors. */
469 const isNoSuchMethodError = const _NoSuchMethodError(); 469 const isNoSuchMethodError = const _NoSuchMethodError();
470 470
471 /** A matcher for functions that throw NoSuchMethodError. */ 471 /** A matcher for functions that throw NoSuchMethodError. */
472 const Matcher throwsNoSuchMethodError = 472 const Matcher throwsNoSuchMethodError =
473 const Throws(isNoSuchMethodError); 473 const Throws(isNoSuchMethodError);
474 474
475 class _NoSuchMethodError extends TypeMatcher { 475 class _NoSuchMethodError extends TypeMatcher {
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
689 description.add(_featureDescription).add(' ').addDescriptionOf(_matcher); 689 description.add(_featureDescription).add(' ').addDescriptionOf(_matcher);
690 690
691 Description describeMismatch(item, Description mismatchDescription, 691 Description describeMismatch(item, Description mismatchDescription,
692 MatchState matchState, bool verbose) { 692 MatchState matchState, bool verbose) {
693 mismatchDescription.add(_featureName).add(' '); 693 mismatchDescription.add(_featureName).add(' ');
694 _matcher.describeMismatch(matchState.state['feature'], mismatchDescription, 694 _matcher.describeMismatch(matchState.state['feature'], mismatchDescription,
695 matchState.state['innerState'], verbose); 695 matchState.state['innerState'], verbose);
696 return mismatchDescription; 696 return mismatchDescription;
697 } 697 }
698 } 698 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698