mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-03 22:05:39 +02:00
Add support for multiply calling lambda parsers in Clara
Previously a lambda parser in Clara could only be invoked once, even if it internally was ok with being invoked multiple times. With this change, a lambda parser can mark itself as `accept_many`, in which case it will be invoked multiple times if the appropriate flag was supplied multiple times by the user.
This commit is contained in:
@@ -2908,6 +2908,35 @@ Clara.tests.cpp:<line number>: PASSED:
|
||||
with expansion:
|
||||
"foo" == "foo"
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Clara::Opt supports accept-many lambdas
|
||||
Parsing fails on multiple options without accept_many
|
||||
-------------------------------------------------------------------------------
|
||||
Clara.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Clara.tests.cpp:<line number>: PASSED:
|
||||
CHECK_FALSE( parse_result )
|
||||
with expansion:
|
||||
!{?}
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Clara::Opt supports accept-many lambdas
|
||||
Parsing succeeds on multiple options with accept_many
|
||||
-------------------------------------------------------------------------------
|
||||
Clara.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Clara.tests.cpp:<line number>: PASSED:
|
||||
CHECK( parse_result )
|
||||
with expansion:
|
||||
{?}
|
||||
|
||||
Clara.tests.cpp:<line number>: PASSED:
|
||||
CHECK( res == std::vector<std::string>{ "aaa", "bbb" } )
|
||||
with expansion:
|
||||
{ "aaa", "bbb" } == { "aaa", "bbb" }
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Combining MatchAllOfGeneric does not nest
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -14962,6 +14991,60 @@ Tricky.tests.cpp:<line number>
|
||||
|
||||
No assertions in test case 'has printf'
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
is_unary_function
|
||||
-------------------------------------------------------------------------------
|
||||
Clara.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Clara.tests.cpp:<line number>: PASSED:
|
||||
with message:
|
||||
Catch::Clara::Detail::is_unary_function<decltype(unary1)>::value
|
||||
|
||||
Clara.tests.cpp:<line number>: PASSED:
|
||||
with message:
|
||||
Catch::Clara::Detail::is_unary_function<decltype(unary2)>::value
|
||||
|
||||
Clara.tests.cpp:<line number>: PASSED:
|
||||
with message:
|
||||
Catch::Clara::Detail::is_unary_function<decltype(unary3)>::value
|
||||
|
||||
Clara.tests.cpp:<line number>: PASSED:
|
||||
with message:
|
||||
Catch::Clara::Detail::is_unary_function<decltype(unary4)>::value
|
||||
|
||||
Clara.tests.cpp:<line number>: PASSED:
|
||||
with message:
|
||||
Catch::Clara::Detail::is_unary_function<decltype(unary5)>::value
|
||||
|
||||
Clara.tests.cpp:<line number>: PASSED:
|
||||
with message:
|
||||
Catch::Clara::Detail::is_unary_function<decltype(unary6)>::value
|
||||
|
||||
Clara.tests.cpp:<line number>: PASSED:
|
||||
with message:
|
||||
!(Catch::Clara::Detail::is_unary_function<decltype(binary1)>::value)
|
||||
|
||||
Clara.tests.cpp:<line number>: PASSED:
|
||||
with message:
|
||||
!(Catch::Clara::Detail::is_unary_function<decltype(binary2)>::value)
|
||||
|
||||
Clara.tests.cpp:<line number>: PASSED:
|
||||
with message:
|
||||
!(Catch::Clara::Detail::is_unary_function<decltype(nullary1)>::value)
|
||||
|
||||
Clara.tests.cpp:<line number>: PASSED:
|
||||
with message:
|
||||
!(Catch::Clara::Detail::is_unary_function<decltype(nullary2)>::value)
|
||||
|
||||
Clara.tests.cpp:<line number>: PASSED:
|
||||
with message:
|
||||
!(Catch::Clara::Detail::is_unary_function<int>::value)
|
||||
|
||||
Clara.tests.cpp:<line number>: PASSED:
|
||||
with message:
|
||||
!(Catch::Clara::Detail::is_unary_function<std::string const&>::value)
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
just failure
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -17144,6 +17227,6 @@ Misc.tests.cpp:<line number>
|
||||
Misc.tests.cpp:<line number>: PASSED:
|
||||
|
||||
===============================================================================
|
||||
test cases: 374 | 281 passed | 86 failed | 7 failed as expected
|
||||
assertions: 2144 | 1971 passed | 146 failed | 27 failed as expected
|
||||
test cases: 376 | 283 passed | 86 failed | 7 failed as expected
|
||||
assertions: 2159 | 1986 passed | 146 failed | 27 failed as expected
|
||||
|
||||
|
Reference in New Issue
Block a user