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

Unified Diff: pkg/unittest/test/matchers_test.dart

Issue 12217142: Unit test improvements: (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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
Index: pkg/unittest/test/matchers_test.dart
===================================================================
--- pkg/unittest/test/matchers_test.dart (revision 18358)
+++ pkg/unittest/test/matchers_test.dart (working copy)
@@ -128,6 +128,8 @@
shouldFail(doesNotThrow, throws,
"Expected: throws an exception but: no exception.");
shouldPass(doesThrow, throws);
+ shouldFail(true, throws,
+ "Expected: throws an exception but: not a Function or Future.");
});
test('throwsA', () {
@@ -243,6 +245,15 @@
"but: was <[0, 0]> with length of <2>.");
shouldPass(b, hasLength(2));
});
+
+ test('type mismatch', () {
+ var a = new DateTime.utc(2000);
+ var b = a.toString();
+ shouldFail(a, equals(b),
+ "Expected: '2000-01-01 00:00:00.000Z' "
+ "but: expected String:'2000-01-01 00:00:00.000Z' "
+ "but was DateTime:<2000-01-01 00:00:00.000Z>.");
+ });
});
group('Numeric Matchers', () {

Powered by Google App Engine
This is Rietveld 408576698