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

Side by Side Diff: test/pretty_print_test.dart

Issue 891463004: Correctly match and print strings with escaped values (Closed) Base URL: https://github.com/dart-lang/matcher.git@master
Patch Set: nits Created 5 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 unified diff | Download patch
« no previous file with comments | « test/escape_test.dart ('k') | test/string_matchers_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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;
10 10
(...skipping 12 matching lines...) Expand all
23 }); 23 });
24 24
25 test('containing newlines', () { 25 test('containing newlines', () {
26 expect(prettyPrint('foo\nbar\nbaz'), equals("'foo\\n'\n" 26 expect(prettyPrint('foo\nbar\nbaz'), equals("'foo\\n'\n"
27 " 'bar\\n'\n" 27 " 'bar\\n'\n"
28 " 'baz'")); 28 " 'baz'"));
29 }); 29 });
30 30
31 test('containing escapable characters', () { 31 test('containing escapable characters', () {
32 expect( 32 expect(
33 prettyPrint("foo\rbar\tbaz'qux"), equals("'foo\\rbar\\tbaz\\'qux'")); 33 prettyPrint("foo\rbar\tbaz'qux\v"), equals(r"'foo\rbar\tbaz\'qux\v'")) ;
34 }); 34 });
35 }); 35 });
36 36
37 group('with an iterable', () { 37 group('with an iterable', () {
38 test('containing primitive objects', () { 38 test('containing primitive objects', () {
39 expect(prettyPrint([1, true, 'foo']), equals("[1, true, 'foo']")); 39 expect(prettyPrint([1, true, 'foo']), equals("[1, true, 'foo']"));
40 }); 40 });
41 41
42 test('containing a multiline string', () { 42 test('containing a multiline string', () {
43 expect(prettyPrint(['foo', 'bar\nbaz\nbip', 'qux']), equals("[\n" 43 expect(prettyPrint(['foo', 'bar\nbaz\nbip', 'qux']), equals("[\n"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW
« no previous file with comments | « test/escape_test.dart ('k') | test/string_matchers_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698