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

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

Issue 11027072: Abstract is now required on abstract classes so adding that. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/unittest/collection_matchers.dart ('k') | pkg/unittest/matcher.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 5
6 /** 6 /**
7 * Returns a matcher that matches empty strings, maps or collections. 7 * Returns a matcher that matches empty strings, maps or collections.
8 */ 8 */
9 const Matcher isEmpty = const _Empty(); 9 const Matcher isEmpty = const _Empty();
10 10
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 * 386 *
387 * bool _isException(x) => x is Exception; 387 * bool _isException(x) => x is Exception;
388 * final Matcher isException = const _Predicate(_isException, "Exception"); 388 * final Matcher isException = const _Predicate(_isException, "Exception");
389 * final Matcher throwsException = const _Throws(isException); 389 * final Matcher throwsException = const _Throws(isException);
390 * 390 *
391 * But currently using static functions in const expressions is not supported. 391 * But currently using static functions in const expressions is not supported.
392 * For now the only solution for all platforms seems to be separate classes 392 * For now the only solution for all platforms seems to be separate classes
393 * for each exception type. 393 * for each exception type.
394 */ 394 */
395 395
396 /* abstract */ class ExceptionMatcher extends BaseMatcher { 396 abstract class ExceptionMatcher extends BaseMatcher {
397 final String _name; 397 final String _name;
398 const ExceptionMatcher(this._name); 398 const ExceptionMatcher(this._name);
399 Description describe(Description description) => 399 Description describe(Description description) =>
400 description.add(_name); 400 description.add(_name);
401 } 401 }
402 402
403 /** A matcher for FormatExceptions. */ 403 /** A matcher for FormatExceptions. */
404 const isFormatException = const _FormatException(); 404 const isFormatException = const _FormatException();
405 405
406 /** A matcher for functions that throw FormatException */ 406 /** A matcher for functions that throw FormatException */
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
618 final _matcher; 618 final _matcher;
619 final String _description; 619 final String _description;
620 620
621 const _Predicate(this._matcher, this._description); 621 const _Predicate(this._matcher, this._description);
622 622
623 bool matches(item, MatchState matchState) => _matcher(item); 623 bool matches(item, MatchState matchState) => _matcher(item);
624 624
625 Description describe(Description description) => 625 Description describe(Description description) =>
626 description.add(_description); 626 description.add(_description);
627 } 627 }
OLDNEW
« no previous file with comments | « pkg/unittest/collection_matchers.dart ('k') | pkg/unittest/matcher.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698