Index: packages/matcher/test/pretty_print_test.dart |
diff --git a/packages/matcher/test/pretty_print_test.dart b/packages/matcher/test/pretty_print_test.dart |
index 1319b9cf61b8592947f335fd773be057ba0f2876..c809df0c753a6b7210ec2c5da6aa563afa9c3027 100644 |
--- a/packages/matcher/test/pretty_print_test.dart |
+++ b/packages/matcher/test/pretty_print_test.dart |
@@ -2,8 +2,6 @@ |
// for details. All rights reserved. Use of this source code is governed by a |
// BSD-style license that can be found in the LICENSE file. |
-library matcher.pretty_print_test; |
- |
import 'dart:collection'; |
import 'package:matcher/matcher.dart'; |
@@ -30,7 +28,7 @@ void main() { |
expect(prettyPrint(12.13), equals('<12.13>')); |
expect(prettyPrint(true), equals('<true>')); |
expect(prettyPrint(null), equals('<null>')); |
- expect(prettyPrint(() => 12), matches(r'<Closure(: \(\) => dynamic)?>')); |
+ expect(prettyPrint(() => 12), matches(r'<Closure.*>')); |
}); |
group('with a string', () { |
@@ -39,14 +37,16 @@ void main() { |
}); |
test('containing newlines', () { |
- expect(prettyPrint('foo\nbar\nbaz'), equals("'foo\\n'\n" |
- " 'bar\\n'\n" |
- " 'baz'")); |
+ expect( |
+ prettyPrint('foo\nbar\nbaz'), |
+ equals("'foo\\n'\n" |
+ " 'bar\\n'\n" |
+ " 'baz'")); |
}); |
test('containing escapable characters', () { |
- expect( |
- prettyPrint("foo\rbar\tbaz'qux\v"), equals(r"'foo\rbar\tbaz\'qux\v'")); |
+ expect(prettyPrint("foo\rbar\tbaz'qux\v"), |
+ equals(r"'foo\rbar\tbaz\'qux\v'")); |
}); |
}); |
@@ -56,13 +56,15 @@ void main() { |
}); |
test('containing a multiline string', () { |
- expect(prettyPrint(['foo', 'bar\nbaz\nbip', 'qux']), equals("[\n" |
- " 'foo',\n" |
- " 'bar\\n'\n" |
- " 'baz\\n'\n" |
- " 'bip',\n" |
- " 'qux'\n" |
- "]")); |
+ expect( |
+ prettyPrint(['foo', 'bar\nbaz\nbip', 'qux']), |
+ equals("[\n" |
+ " 'foo',\n" |
+ " 'bar\\n'\n" |
+ " 'baz\\n'\n" |
+ " 'bip',\n" |
+ " 'qux'\n" |
+ "]")); |
}); |
test('containing a matcher', () { |
@@ -76,7 +78,8 @@ void main() { |
}); |
test("that's over maxLineLength", () { |
- expect(prettyPrint([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], maxLineLength: 29), |
+ expect( |
+ prettyPrint([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], maxLineLength: 29), |
equals("[\n" |
" 0,\n" |
" 1,\n" |
@@ -92,23 +95,27 @@ void main() { |
}); |
test("factors indentation into maxLineLength", () { |
- expect(prettyPrint(["foo\nbar", [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],], |
- maxLineLength: 30), equals("[\n" |
- " 'foo\\n'\n" |
- " 'bar',\n" |
- " [\n" |
- " 0,\n" |
- " 1,\n" |
- " 2,\n" |
- " 3,\n" |
- " 4,\n" |
- " 5,\n" |
- " 6,\n" |
- " 7,\n" |
- " 8,\n" |
- " 9\n" |
- " ]\n" |
- "]")); |
+ expect( |
+ prettyPrint([ |
+ "foo\nbar", |
+ [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], |
+ ], maxLineLength: 30), |
+ equals("[\n" |
+ " 'foo\\n'\n" |
+ " 'bar',\n" |
+ " [\n" |
+ " 0,\n" |
+ " 1,\n" |
+ " 2,\n" |
+ " 3,\n" |
+ " 4,\n" |
+ " 5,\n" |
+ " 6,\n" |
+ " 7,\n" |
+ " 8,\n" |
+ " 9\n" |
+ " ]\n" |
+ "]")); |
}); |
test("that's under maxItems", () { |
@@ -122,7 +129,7 @@ void main() { |
}); |
test("that's recursive", () { |
- var list = [1, 2, 3]; |
+ var list = <dynamic>[1, 2, 3]; |
list.add(list); |
expect(prettyPrint(list), equals("[1, 2, 3, (recursive)]")); |
}); |
@@ -135,27 +142,33 @@ void main() { |
}); |
test('containing a multiline string key', () { |
- expect(prettyPrint({'foo\nbar': 1, 'bar': true}), equals("{\n" |
- " 'foo\\n'\n" |
- " 'bar': 1,\n" |
- " 'bar': true\n" |
- "}")); |
+ expect( |
+ prettyPrint({'foo\nbar': 1, 'bar': true}), |
+ equals("{\n" |
+ " 'foo\\n'\n" |
+ " 'bar': 1,\n" |
+ " 'bar': true\n" |
+ "}")); |
}); |
test('containing a multiline string value', () { |
- expect(prettyPrint({'foo': 'bar\nbaz', 'qux': true}), equals("{\n" |
- " 'foo': 'bar\\n'\n" |
- " 'baz',\n" |
- " 'qux': true\n" |
- "}")); |
+ expect( |
+ prettyPrint({'foo': 'bar\nbaz', 'qux': true}), |
+ equals("{\n" |
+ " 'foo': 'bar\\n'\n" |
+ " 'baz',\n" |
+ " 'qux': true\n" |
+ "}")); |
}); |
test('containing a multiline string key/value pair', () { |
- expect(prettyPrint({'foo\nbar': 'baz\nqux'}), equals("{\n" |
- " 'foo\\n'\n" |
- " 'bar': 'baz\\n'\n" |
- " 'qux'\n" |
- "}")); |
+ expect( |
+ prettyPrint({'foo\nbar': 'baz\nqux'}), |
+ equals("{\n" |
+ " 'foo\\n'\n" |
+ " 'bar': 'baz\\n'\n" |
+ " 'qux'\n" |
+ "}")); |
}); |
test('containing a matcher key', () { |
@@ -174,7 +187,8 @@ void main() { |
}); |
test("that's over maxLineLength", () { |
- expect(prettyPrint({'0': 1, '2': 3, '4': 5, '6': 7}, maxLineLength: 31), |
+ expect( |
+ prettyPrint({'0': 1, '2': 3, '4': 5, '6': 7}, maxLineLength: 31), |
equals("{\n" |
" '0': 1,\n" |
" '2': 3,\n" |
@@ -184,17 +198,21 @@ void main() { |
}); |
test("factors indentation into maxLineLength", () { |
- expect(prettyPrint(["foo\nbar", {'0': 1, '2': 3, '4': 5, '6': 7}], |
- maxLineLength: 32), equals("[\n" |
- " 'foo\\n'\n" |
- " 'bar',\n" |
- " {\n" |
- " '0': 1,\n" |
- " '2': 3,\n" |
- " '4': 5,\n" |
- " '6': 7\n" |
- " }\n" |
- "]")); |
+ expect( |
+ prettyPrint([ |
+ "foo\nbar", |
+ {'0': 1, '2': 3, '4': 5, '6': 7} |
+ ], maxLineLength: 32), |
+ equals("[\n" |
+ " 'foo\\n'\n" |
+ " 'bar',\n" |
+ " {\n" |
+ " '0': 1,\n" |
+ " '2': 3,\n" |
+ " '4': 5,\n" |
+ " '6': 7\n" |
+ " }\n" |
+ "]")); |
}); |
test("that's under maxItems", () { |