Fix the prints matcher test on dart2js.
R=rnystrom@google.com
Review URL: https://codereview.chromium.org//793163002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart/pkg/matcher@42274 260f80e4-7a28-3924-810f-c04153c831b5
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4e847d8..aaf5a4d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 0.11.3+1
+
+* Fix the `prints` matcher test on dart2js.
+
## 0.11.3
* Add a `prints` matcher that matches output a callback emits via `print`.
diff --git a/pubspec.yaml b/pubspec.yaml
index 1951a5b..fb3f68b 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,5 +1,5 @@
name: matcher
-version: 0.11.3
+version: 0.11.3+1
author: Dart Team <misc@dartlang.org>
description: Support for specifying test expectations
homepage: https://pub.dartlang.org/packages/matcher
diff --git a/test/prints_matcher_test.dart b/test/prints_matcher_test.dart
index 183d4ef..9c7dd4c 100644
--- a/test/prints_matcher_test.dart
+++ b/test/prints_matcher_test.dart
@@ -11,6 +11,9 @@
import 'test_utils.dart';
+/// The VM and dart2js have different toStrings for closures.
+final closureToString = (() {}).toString();
+
void main() {
initUtils();
@@ -33,7 +36,7 @@
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 @@
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.");
});
});