aboutsummaryrefslogtreecommitdiff
path: root/test/common
diff options
context:
space:
mode:
Diffstat (limited to 'test/common')
-rw-r--r--test/common/Event2Test.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/common/Event2Test.cpp b/test/common/Event2Test.cpp
index e14174cf..0d3222cc 100644
--- a/test/common/Event2Test.cpp
+++ b/test/common/Event2Test.cpp
@@ -39,4 +39,16 @@ TEST_CASE("Event2", "[event2]") {
event.Raise();
REQUIRE(counter == 3);
}
+
+ SECTION("stop handling should work.") {
+ auto short_circuit_handler = [&counter](decltype(event)::Context* context) {
+ context->SetStopHandling();
+ };
+
+ event.AddHandler(short_circuit_handler);
+ event.AddHandler(handler2);
+
+ event.Raise();
+ REQUIRE(counter == 1);
+ }
}