Added support for C++11 lambdas as constraints

git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@620 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
mat007 2013-04-11 16:24:26 +00:00
parent c5861a744d
commit 4afe1d32d4
6 changed files with 77 additions and 10 deletions

View file

@ -590,6 +590,14 @@ Example using [@http://www.boost.org/libs/phoenix Boost.Phoenix] :
MOCK_EXPECT( c.method ).with( boost::phoenix::arg_names::_1 == 42 );
}
Example using C++11 lambdas :
BOOST_AUTO_TEST_CASE( demonstrates_adding_a_constraint_with_cxx11_lambda )
{
mock_class c;
MOCK_EXPECT( c.method ).with( []( int actual ) { return 42 == actual; } );
}
Example using &&, || and ! :
BOOST_AUTO_TEST_CASE( demonstrates_combining_constraints )