#include #include #include #include #include int main() { using namespace Void::TestingMock; MockSession session; MockFunction(std::string)> fn{session, "lookup"}; auto exp = fn.try_expect( AllOf(StartsWith("k_"), EndsWith("_1"))); if (!exp.has_value()) { return 1; } (*exp)->returns_once(std::make_unique(42)); if (!freeze(session, Concurrency::SingleThread).has_value()) { return 2; } auto out = fn("k_ok_1"); if (!out || *out != 42) { return 3; } auto rep = verify_and_close(session); if (!rep.has_value() || !rep->ok()) { return 4; } return 0; }