diff --git a/test/Window/Event.test.cpp b/test/Window/Event.test.cpp index 9977f3618..88e01a82f 100644 --- a/test/Window/Event.test.cpp +++ b/test/Window/Event.test.cpp @@ -2,6 +2,7 @@ #include +#include #include #include @@ -340,5 +341,13 @@ TEST_CASE("[Window] sf::Event") const sf::Event focusLost = sf::Event::FocusLost{}; CHECK(focusLost.visit(visitor) == "Other"); } + + SECTION("Move-only visitor") + { + auto moveOnlyVisitor = [ptr = std::make_unique("It works")](const auto&) { return *ptr; }; + + const sf::Event closed = sf::Event::Closed{}; + CHECK(closed.visit(moveOnlyVisitor) == "It works"); + } } }