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

Unified Diff: tests/lib/unittest/matchers_test.dart

Issue 10832058: Improved the way we generate mismatch descriptions. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/lib/unittest/instance_test.dart ('k') | tests/lib/unittest/unittest_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/unittest/matchers_test.dart
===================================================================
--- tests/lib/unittest/matchers_test.dart (revision 10002)
+++ tests/lib/unittest/matchers_test.dart (working copy)
@@ -12,7 +12,7 @@
class PrefixMatcher extends BaseMatcher {
final String _prefix;
const PrefixMatcher(this._prefix);
- bool matches(item) {
+ bool matches(item, MatchState matchState) {
return item is String &&
(collapseWhitespace(item)).startsWith(collapseWhitespace(_prefix));
}
@@ -83,7 +83,7 @@
shouldPass(doesThrow, throwsA(equals('X')));
shouldFail(doesThrow, throwsA(equals('Y')),
"Expected: throws an exception which matches 'Y' "
- "but: no exception or exception does not match 'Y'.");
+ "but: exception 'X' does not match 'Y'.");
});
test('throwsBadNumberFormatException', () {
@@ -92,7 +92,7 @@
shouldFail(() { throw new Exception(); },
throwsBadNumberFormatException,
"Expected: throws an exception which matches BadNumberFormatException "
- "but: no exception or exception does not match "
+ "but: exception <Exception> does not match "
"BadNumberFormatException.");
});
@@ -102,7 +102,7 @@
shouldFail(() { throw new Exception(); },
throwsIllegalArgumentException,
"Expected: throws an exception which matches IllegalArgumentException "
- "but: no exception or exception does not match "
+ "but: exception <Exception> does not match "
"IllegalArgumentException.");
});
@@ -112,7 +112,7 @@
shouldFail(() { throw new Exception(); },
throwsIllegalJSRegExpException,
"Expected: throws an exception which matches IllegalJSRegExpException "
- "but: no exception or exception does not match "
+ "but: exception <Exception> does not match "
"IllegalJSRegExpException.");
});
@@ -122,7 +122,7 @@
shouldFail(() { throw new Exception(); },
throwsIndexOutOfRangeException,
"Expected: throws an exception which matches IndexOutOfRangeException "
- "but: no exception or exception does not match "
+ "but: exception <Exception> does not match "
"IndexOutOfRangeException.");
});
@@ -132,7 +132,7 @@
shouldFail(() { throw new Exception(); },
throwsNoSuchMethodException,
"Expected: throws an exception which matches NoSuchMethodException "
- "but: no exception or exception does not match "
+ "but: exception <Exception> does not match "
"NoSuchMethodException.");
});
@@ -142,7 +142,7 @@
shouldFail(() { throw new Exception(); },
throwsNotImplementedException,
"Expected: throws an exception which matches NotImplementedException "
- "but: no exception or exception does not match "
+ "but: exception <Exception> does not match "
"NotImplementedException.");
});
@@ -152,7 +152,7 @@
shouldFail(() { throw new Exception(); },
throwsNullPointerException,
"Expected: throws an exception which matches NullPointerException "
- "but: no exception or exception does not match "
+ "but: exception <Exception> does not match "
"NullPointerException.");
});
@@ -163,14 +163,14 @@
throwsUnsupportedOperationException,
"Expected: throws an exception which matches "
"UnsupportedOperationException "
- "but: no exception or exception does not match "
+ "but: exception <Exception> does not match "
"UnsupportedOperationException.");
});
test('returnsNormally', () {
shouldPass(doesNotThrow, returnsNormally);
shouldFail(doesThrow, returnsNormally,
- "Expected: return normally but: threw exception.");
+ "Expected: return normally but: threw 'X'.");
});
test('hasLength', () {
@@ -412,7 +412,7 @@
var d = [1, 2];
var e = [1, 1, 1];
shouldFail(d, everyElement(1),
- "Expected: every element <1> but: was <[1, 2]>.");
+ "Expected: every element <1> but: was <2> at position 1.");
shouldPass(e, everyElement(1));
});
« no previous file with comments | « tests/lib/unittest/instance_test.dart ('k') | tests/lib/unittest/unittest_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698