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

Side by Side Diff: test/prints_matcher_test.dart

Issue 840133003: matcher: fixed status file, formatting, tweaks to readme (Closed) Base URL: https://github.com/dart-lang/matcher.git@master
Patch Set: nits Created 5 years, 11 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/pretty_print_unminified_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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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.prints_matchers_test; 5 library matcher.prints_matchers_test;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:matcher/matcher.dart'; 9 import 'package:matcher/matcher.dart';
10 import 'package:unittest/unittest.dart'; 10 import 'package:unittest/unittest.dart';
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 }), prints("Hello\nWorld!\n")); 72 }), prints("Hello\nWorld!\n"));
73 }); 73 });
74 74
75 test("works with a Matcher", () { 75 test("works with a Matcher", () {
76 shouldPass(() => new Future(() => print("Hello, world!")), 76 shouldPass(() => new Future(() => print("Hello, world!")),
77 prints(contains("Hello"))); 77 prints(contains("Hello")));
78 }); 78 });
79 79
80 test("describes a failure nicely", () { 80 test("describes a failure nicely", () {
81 shouldFail(() => new Future(() => print("Hello, world!")), 81 shouldFail(() => new Future(() => print("Hello, world!")),
82 prints("Goodbye, world!\n"), 82 prints("Goodbye, world!\n"), "Expected: 'Goodbye, world!\\n' ''"
83 "Expected: 'Goodbye, world!\\n' ''"
84 " Actual: 'Hello, world!\\n' ''" 83 " Actual: 'Hello, world!\\n' ''"
85 " Which: is different. " 84 " Which: is different. "
86 "Expected: Goodbye, w ... " 85 "Expected: Goodbye, w ... "
87 " Actual: Hello, wor ... " 86 " Actual: Hello, wor ... "
88 " ^ Differ at offset 0", 87 " ^ Differ at offset 0", isAsync: true);
89 isAsync: true);
90 }); 88 });
91 89
92 test("describes a failure with a non-descriptive Matcher nicely", () { 90 test("describes a failure with a non-descriptive Matcher nicely", () {
93 shouldFail(() => new Future(() => print("Hello, world!")), 91 shouldFail(() => new Future(() => print("Hello, world!")),
94 prints(contains("Goodbye")), 92 prints(contains("Goodbye")), "Expected: contains 'Goodbye'"
95 "Expected: contains 'Goodbye'" 93 " Actual: 'Hello, world!\\n' ''", isAsync: true);
96 " Actual: 'Hello, world!\\n' ''",
97 isAsync: true);
98 }); 94 });
99 95
100 test("describes a failure with no text nicely", () { 96 test("describes a failure with no text nicely", () {
101 shouldFail(() => new Future.value(), prints(contains("Goodbye")), 97 shouldFail(() => new Future.value(), prints(contains("Goodbye")),
102 "Expected: contains 'Goodbye'" 98 "Expected: contains 'Goodbye'"
103 " Actual: ''", 99 " Actual: ''", isAsync: true);
104 isAsync: true);
105 }); 100 });
106 }); 101 });
107 } 102 }
OLDNEW
« no previous file with comments | « test/pretty_print_unminified_test.dart ('k') | test/string_matchers_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698