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

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

Issue 184103002: Support nested matchers in deep equality matching. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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/pretty_print_test.dart
diff --git a/pkg/unittest/test/pretty_print_test.dart b/pkg/unittest/test/pretty_print_test.dart
index a0608ac0f9cafa1f248f8dd24e12fef3936584b8..826c345187835125ed807af2ec34150d7bce95f4 100644
--- a/pkg/unittest/test/pretty_print_test.dart
+++ b/pkg/unittest/test/pretty_print_test.dart
@@ -48,6 +48,11 @@ void main() {
"]"));
});
+ test('containing a matcher', () {
+ expect(prettyPrint(['foo', endsWith('qux')]),
+ equals("['foo', <a string ending with 'qux'>]"));
+ });
+
test("that's under maxLineLength", () {
expect(prettyPrint([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], maxLineLength: 30),
equals("[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]"));
@@ -138,6 +143,16 @@ void main() {
"}"));
});
+ test('containing a matcher key', () {
+ expect(prettyPrint({endsWith('bar'): 'qux'}),
+ equals("{<a string ending with 'bar'>: 'qux'}"));
+ });
+
+ test('containing a matcher value', () {
+ expect(prettyPrint({'foo': endsWith('qux')}),
+ equals("{'foo': <a string ending with 'qux'>}"));
+ });
+
test("that's under maxLineLength", () {
expect(prettyPrint({'0': 1, '2': 3, '4': 5, '6': 7}, maxLineLength: 32),
equals("{'0': 1, '2': 3, '4': 5, '6': 7}"));
« pkg/unittest/test/matchers_test.dart ('K') | « pkg/unittest/test/matchers_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698