eranpeer / FakeIt

C++ mocking made easy. A simple yet very expressive, headers only library for c++ mocking.
MIT License
1.24k stars 173 forks source link

Perfectly forward callbacks instead of by-copy #225

Closed helmesjo closed 3 years ago

helmesjo commented 3 years ago

In TupleDispatcher.hpp, use perfect forwarding when invoking callbacks instead of always passing by value (makes mutable lambdas work as expected).

Added new test for mutable lambda which passes with fix, and fails without.

All tests pass on GCC & MSVC.

coveralls commented 3 years ago

Coverage Status

Coverage remained the same at 99.923% when pulling 419fe3fe24a088dfe445bfa3a296aaf86d1d526e on helmesjo:perfectly_forward_mock_delegates into 814f28cd509ef2a8cdf7fe370bd9ec6d3b181dc7 on eranpeer:master.

eranpeer commented 3 years ago

Thanks

helmesjo commented 3 years ago

@eranpeer Any release planned?