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

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

Issue 11358060: Change NotImplementedException to UnimplementedError. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review comments. 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
« no previous file with comments | « pkg/intl/lib/src/date_format_field.dart ('k') | pkg/unittest/test/matchers_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 matcher; 5 part of matcher;
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 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 483
484 /** A matcher for functions that throw NoSuchMethodError. */ 484 /** A matcher for functions that throw NoSuchMethodError. */
485 const Matcher throwsNoSuchMethodError = 485 const Matcher throwsNoSuchMethodError =
486 const Throws(isNoSuchMethodError); 486 const Throws(isNoSuchMethodError);
487 487
488 class _NoSuchMethodError extends TypeMatcher { 488 class _NoSuchMethodError extends TypeMatcher {
489 const _NoSuchMethodError() : super("NoSuchMethodError"); 489 const _NoSuchMethodError() : super("NoSuchMethodError");
490 bool matches(item, MatchState matchState) => item is NoSuchMethodError; 490 bool matches(item, MatchState matchState) => item is NoSuchMethodError;
491 } 491 }
492 492
493 /** A matcher for UnimplementedErrors. */
494 const isUnimplementedError = const _UnimplementedError();
495
496 /** A matcher for functions that throw Exception. */
497 const Matcher throwsUnimplementedError =
498 const Throws(isUnimplementedError);
499
500 class _UnimplementedError extends TypeMatcher {
501 const _UnimplementedError() : super("UnimplementedError");
502 bool matches(item, MatchState matchState) => item is UnimplementedError;
503 }
504
505 // Temporary matcher until NotImplementedException is removed.
493 /** A matcher for NotImplementedExceptions. */ 506 /** A matcher for NotImplementedExceptions. */
494 const isNotImplementedException = const _NotImplementedException(); 507 const isNotImplementedException = isUnimplementedError;
495 508
496 /** A matcher for functions that throw Exception. */ 509 /** A matcher for functions that throw Exception. */
497 const Matcher throwsNotImplementedException = 510 const Matcher throwsNotImplementedException =
498 const Throws(isNotImplementedException); 511 const Throws(isUnimplementedError);
499 512
500 class _NotImplementedException extends TypeMatcher {
501 const _NotImplementedException() : super("NotImplementedException");
502 bool matches(item, MatchState matchState) => item is NotImplementedException;
503 }
504 513
505 /** A matcher for NullPointerExceptions. */ 514 /** A matcher for NullPointerExceptions. */
506 const isNullPointerException = const _NullPointerException(); 515 const isNullPointerException = const _NullPointerException();
507 516
508 /** A matcher for functions that throw NotNullPointerException. */ 517 /** A matcher for functions that throw NotNullPointerException. */
509 const Matcher throwsNullPointerException = 518 const Matcher throwsNullPointerException =
510 const Throws(isNullPointerException); 519 const Throws(isNullPointerException);
511 520
512 class _NullPointerException extends TypeMatcher { 521 class _NullPointerException extends TypeMatcher {
513 const _NullPointerException() : super("NullPointerException"); 522 const _NullPointerException() : super("NullPointerException");
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
702 description.add(_featureDescription).add(' ').addDescriptionOf(_matcher); 711 description.add(_featureDescription).add(' ').addDescriptionOf(_matcher);
703 712
704 Description describeMismatch(item, Description mismatchDescription, 713 Description describeMismatch(item, Description mismatchDescription,
705 MatchState matchState, bool verbose) { 714 MatchState matchState, bool verbose) {
706 mismatchDescription.add(_featureName).add(' '); 715 mismatchDescription.add(_featureName).add(' ');
707 _matcher.describeMismatch(matchState.state['feature'], mismatchDescription, 716 _matcher.describeMismatch(matchState.state['feature'], mismatchDescription,
708 matchState.state['innerState'], verbose); 717 matchState.state['innerState'], verbose);
709 return mismatchDescription; 718 return mismatchDescription;
710 } 719 }
711 } 720 }
OLDNEW
« no previous file with comments | « pkg/intl/lib/src/date_format_field.dart ('k') | pkg/unittest/test/matchers_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698