Index: lib/core/expect.dart |
diff --git a/lib/core/expect.dart b/lib/core/expect.dart |
index adf0604666f3101ab70c40f497ce1671d2d7be1d..b26ddc53a99420b95087dcf4e30863150d3eb36d 100644 |
--- a/lib/core/expect.dart |
+++ b/lib/core/expect.dart |
@@ -264,13 +264,16 @@ class Expect { |
String reason = null]) { |
try { |
f(); |
- } catch (e) { |
+ } catch (e, s) { |
if (check !== null) { |
- Expect.isTrue(check(e)); |
+ if (!check(e)) { |
+ String msg = reason == null ? "" : reason; |
+ _fail("Expect.throws($msg): Unexpected '$e'\n$s"); |
+ } |
} |
return; |
} |
- String msg = _getMessage(reason); |
+ String msg = reason == null ? "" : reason; |
_fail('Expect.throws($msg) fails'); |
} |