| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 matcher.pretty_print_test; | 5 library matcher.pretty_print_test; |
| 6 | 6 |
| 7 import 'package:matcher/matcher.dart'; | 7 import 'package:matcher/matcher.dart'; |
| 8 import 'package:matcher/src/pretty_print.dart'; | 8 import 'package:matcher/src/pretty_print.dart'; |
| 9 import 'package:unittest/unittest.dart' show group, test; | 9 import 'package:unittest/unittest.dart' show group, test, expect; |
| 10 | 10 |
| 11 void main() { | 11 void main() { |
| 12 test('with primitive objects', () { | 12 test('with primitive objects', () { |
| 13 expect(prettyPrint(12), equals('<12>')); | 13 expect(prettyPrint(12), equals('<12>')); |
| 14 expect(prettyPrint(12.13), equals('<12.13>')); | 14 expect(prettyPrint(12.13), equals('<12.13>')); |
| 15 expect(prettyPrint(true), equals('<true>')); | 15 expect(prettyPrint(true), equals('<true>')); |
| 16 expect(prettyPrint(null), equals('<null>')); | 16 expect(prettyPrint(null), equals('<null>')); |
| 17 expect(prettyPrint(() => 12), matches(r'<Closure(: \(\) => dynamic)?>')); | 17 expect(prettyPrint(() => 12), matches(r'<Closure(: \(\) => dynamic)?>')); |
| 18 }); | 18 }); |
| 19 | 19 |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 expect(prettyPrint({'0': 1, '2': 3, '4': 5, '6': 7}, maxItems: 4), | 185 expect(prettyPrint({'0': 1, '2': 3, '4': 5, '6': 7}, maxItems: 4), |
| 186 equals("{'0': 1, '2': 3, '4': 5, '6': 7}")); | 186 equals("{'0': 1, '2': 3, '4': 5, '6': 7}")); |
| 187 }); | 187 }); |
| 188 | 188 |
| 189 test("that's over maxItems", () { | 189 test("that's over maxItems", () { |
| 190 expect(prettyPrint({'0': 1, '2': 3, '4': 5, '6': 7}, maxItems: 3), | 190 expect(prettyPrint({'0': 1, '2': 3, '4': 5, '6': 7}, maxItems: 3), |
| 191 equals("{'0': 1, '2': 3, ...}")); | 191 equals("{'0': 1, '2': 3, ...}")); |
| 192 }); | 192 }); |
| 193 }); | 193 }); |
| 194 } | 194 } |
| OLD | NEW |