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

Side by Side Diff: pkg/unittest/test/test_utils.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
« no previous file with comments | « pkg/unittest/test/matchers_unminified_test.dart ('k') | pkg/unittest/test/unittest_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 library test_utils; 5 library test_utils;
6 6
7 import 'package:unittest/unittest.dart'; 7 import 'package:unittest/unittest.dart';
8 8
9 import 'dart:async'; 9 import 'dart:async';
10 10
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 afterTest(); 62 afterTest();
63 } 63 }
64 } 64 }
65 65
66 doesNotThrow() {} 66 doesNotThrow() {}
67 doesThrow() { throw 'X'; } 67 doesThrow() { throw 'X'; }
68 68
69 class PrefixMatcher extends BaseMatcher { 69 class PrefixMatcher extends BaseMatcher {
70 final String _prefix; 70 final String _prefix;
71 const PrefixMatcher(this._prefix); 71 const PrefixMatcher(this._prefix);
72 bool matches(item, MatchState matchState) { 72 bool matches(item, Map matchState) {
73 return item is String && 73 return item is String &&
74 (collapseWhitespace(item)).startsWith(collapseWhitespace(_prefix)); 74 (collapseWhitespace(item)).startsWith(collapseWhitespace(_prefix));
75 } 75 }
76 76
77 Description describe(Description description) => 77 Description describe(Description description) =>
78 description.add('a string starting with '). 78 description.add('a string starting with ').
79 addDescriptionOf(collapseWhitespace(_prefix)). 79 addDescriptionOf(collapseWhitespace(_prefix)).
80 add(' ignoring whitespace'); 80 add(' ignoring whitespace');
81 } 81 }
OLDNEW
« no previous file with comments | « pkg/unittest/test/matchers_unminified_test.dart ('k') | pkg/unittest/test/unittest_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698