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

Unified Diff: pkg/matcher/test/prints_matcher_test.dart

Issue 793163002: Fix the prints matcher test on dart2js. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/matcher/pubspec.yaml ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/matcher/test/prints_matcher_test.dart
diff --git a/pkg/matcher/test/prints_matcher_test.dart b/pkg/matcher/test/prints_matcher_test.dart
index 183d4ef35b7a911aab37db8045c3c37efd4b8acb..9c7dd4c550ba5bb50883787c6a0f536717ff5a0d 100644
--- a/pkg/matcher/test/prints_matcher_test.dart
+++ b/pkg/matcher/test/prints_matcher_test.dart
@@ -11,6 +11,9 @@ import 'package:unittest/unittest.dart';
import 'test_utils.dart';
+/// The VM and dart2js have different toStrings for closures.
+final closureToString = (() {}).toString();
+
void main() {
initUtils();
@@ -33,7 +36,7 @@ void main() {
test("describes a failure nicely", () {
shouldFail(() => print("Hello, world!"), prints("Goodbye, world!\n"),
"Expected: prints 'Goodbye, world!\\n' ''"
- " Actual: <Closure: () => dynamic> "
+ " Actual: <$closureToString> "
" Which: printed 'Hello, world!\\n' ''"
" Which: is different. "
"Expected: Goodbye, w ... "
@@ -44,14 +47,14 @@ void main() {
test("describes a failure with a non-descriptive Matcher nicely", () {
shouldFail(() => print("Hello, world!"), prints(contains("Goodbye")),
"Expected: prints contains 'Goodbye'"
- " Actual: <Closure: () => dynamic> "
+ " Actual: <$closureToString> "
" Which: printed 'Hello, world!\\n' ''");
});
test("describes a failure with no text nicely", () {
shouldFail(() {}, prints(contains("Goodbye")),
"Expected: prints contains 'Goodbye'"
- " Actual: <Closure: () => dynamic> "
+ " Actual: <$closureToString> "
" Which: printed nothing.");
});
});
« no previous file with comments | « pkg/matcher/pubspec.yaml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698