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 unittest.matcher.pretty_print_test; | 5 library unittest.matcher.pretty_print_test; |
6 | 6 |
7 import 'package:unittest/unittest.dart'; | 7 import 'package:unittest/unittest.dart'; |
8 import 'package:unittest/src/matcher/pretty_print.dart'; | 8 import 'package:unittest/src/matcher/pretty_print.dart'; |
9 | 9 |
10 void main() { | 10 void main() { |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 expect(prettyPrint([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], maxItems: 10), | 98 expect(prettyPrint([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], maxItems: 10), |
99 equals("[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]")); | 99 equals("[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]")); |
100 }); | 100 }); |
101 | 101 |
102 test("that's over maxItems", () { | 102 test("that's over maxItems", () { |
103 expect(prettyPrint([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], maxItems: 9), | 103 expect(prettyPrint([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], maxItems: 9), |
104 equals("[0, 1, 2, 3, 4, 5, 6, 7, ...]")); | 104 equals("[0, 1, 2, 3, 4, 5, 6, 7, ...]")); |
105 }); | 105 }); |
106 | 106 |
107 test("that's recursive", () { | 107 test("that's recursive", () { |
108 var list = [1, 2, 3]; | 108 var list = <Object>[1, 2, 3]; |
109 list.add(list); | 109 list.add(list); |
110 expect(prettyPrint(list), equals("[1, 2, 3, (recursive)]")); | 110 expect(prettyPrint(list), equals("[1, 2, 3, (recursive)]")); |
111 }); | 111 }); |
112 }); | 112 }); |
113 | 113 |
114 group("with a map", () { | 114 group("with a map", () { |
115 test('containing primitive objects', () { | 115 test('containing primitive objects', () { |
116 expect(prettyPrint({'foo': 1, 'bar': true}), | 116 expect(prettyPrint({'foo': 1, 'bar': true}), |
117 equals("{'foo': 1, 'bar': true}")); | 117 equals("{'foo': 1, 'bar': true}")); |
118 }); | 118 }); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 expect(prettyPrint({'0': 1, '2': 3, '4': 5, '6': 7}, maxItems: 4), | 184 expect(prettyPrint({'0': 1, '2': 3, '4': 5, '6': 7}, maxItems: 4), |
185 equals("{'0': 1, '2': 3, '4': 5, '6': 7}")); | 185 equals("{'0': 1, '2': 3, '4': 5, '6': 7}")); |
186 }); | 186 }); |
187 | 187 |
188 test("that's over maxItems", () { | 188 test("that's over maxItems", () { |
189 expect(prettyPrint({'0': 1, '2': 3, '4': 5, '6': 7}, maxItems: 3), | 189 expect(prettyPrint({'0': 1, '2': 3, '4': 5, '6': 7}, maxItems: 3), |
190 equals("{'0': 1, '2': 3, ...}")); | 190 equals("{'0': 1, '2': 3, ...}")); |
191 }); | 191 }); |
192 }); | 192 }); |
193 } | 193 } |
OLD | NEW |