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

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

Issue 16408019: Improved error messages from unittest. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 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
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 * MatchState is a simple wrapper around an arbitrary object. 8 * MatchState is a simple wrapper around an arbitrary object.
9 * [Matcher] [matches] methods can use this to store useful 9 * [Matcher] [matches] methods can use this to store useful
10 * information upon match failures, and this information will 10 * information upon match failures, and this information will
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 * by appending to [mismatchDescription]. 43 * by appending to [mismatchDescription].
44 */ 44 */
45 Description describe(Description mismatchDescription); 45 Description describe(Description mismatchDescription);
46 46
47 /** 47 /**
48 * Generates a description of the matcher failed for a particular 48 * Generates a description of the matcher failed for a particular
49 * [item], by appending the description to [mismatchDescription]. 49 * [item], by appending the description to [mismatchDescription].
50 * It does not check whether the [item] fails the match, as it is 50 * It does not check whether the [item] fails the match, as it is
51 * only called after a failed match. There may be additional info 51 * only called after a failed match. There may be additional info
52 * about the mismatch in [matchState]. 52 * about the mismatch in [matchState].
53 * The base matcher does not add anything as the actual value is
54 * typically sufficient, but matchers that can add valuable info
55 * should override this.
53 */ 56 */
54 Description describeMismatch(item, Description mismatchDescription, 57 Description describeMismatch(item, Description mismatchDescription,
55 MatchState matchState, bool verbose) => 58 MatchState matchState, bool verbose) =>
56 mismatchDescription.add('was ').addDescriptionOf(item); 59 mismatchDescription;
57 } 60 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698