Index: lib/src/frontend/expect.dart |
diff --git a/lib/src/frontend/expect.dart b/lib/src/frontend/expect.dart |
index 71a141694f42ba7f0a04415ca4f34651430672c0..d39986b40231df2599403430c43909ff703e40e5 100644 |
--- a/lib/src/frontend/expect.dart |
+++ b/lib/src/frontend/expect.dart |
@@ -6,6 +6,9 @@ library test.frontend.expect; |
import 'package:matcher/matcher.dart'; |
+import '../backend/closed_exception.dart'; |
+import '../backend/invoker.dart'; |
+ |
/// An exception thrown when a test assertion fails. |
class TestFailure { |
final String message; |
@@ -36,6 +39,8 @@ typedef String ErrorFormatter( |
/// [verbose] should be specified as `true`. |
void expect(actual, matcher, |
{String reason, bool verbose: false, ErrorFormatter formatter}) { |
+ if (Invoker.current.closed) throw new ClosedException(); |
+ |
matcher = wrapMatcher(matcher); |
var matchState = {}; |
try { |