|
mimic++ v9.2.1
|
Requirements determine, whether an expectation matches an incoming call. More...
Functions | |
| template<std::size_t index, typename Matcher, typename Projection = std::identity> | |
| constexpr auto | mimicpp::expect::arg (Matcher &&matcher, Projection &&projection={}) noexcept(std::is_nothrow_constructible_v< std::remove_cvref_t< Matcher >, Matcher > &&std::is_nothrow_constructible_v< std::remove_cvref_t< Projection >, Projection >) |
| Checks whether the selected argument satisfies the given matcher. | |
| template<std::size_t first, std::size_t... others, typename Matcher, typename... Projections> | |
| constexpr auto | mimicpp::expect::args (Matcher &&matcher, Projections &&... projections) noexcept(std::is_nothrow_constructible_v< std::remove_cvref_t< Matcher >, Matcher > &&(... &&std::is_nothrow_move_constructible_v< std::remove_cvref_t< Projections > >)) |
| Checks whether the selected arguments satisfy the given matcher. | |
| template<typename Matcher> | |
| constexpr auto | mimicpp::expect::all_args (Matcher &&matcher) noexcept(std::is_nothrow_constructible_v< std::remove_cvref_t< Matcher >, Matcher >) |
| Checks whether the all arguments satisfy the given matcher. | |
Requirements determine, whether an expectation matches an incoming call.
Requirements are the building blocks, which determine whether a call satisfies the expectation. If any of the specified requirements fail, there is no match.
|
nodiscardconstexprnoexcept |
Checks whether the all arguments satisfy the given matcher.
| Matcher | The matcher type. |
| matcher | The matcher. |
This requirement checks, whether the all arguments satisfy the given matcher. It's useful, when all arguments must be checked together, because they have some kind of relationship. When n arguments are provided the matcher must accept n arguments.
For a list of built-in matchers, see matcher section.
|
nodiscardconstexprnoexcept |
Checks whether the selected argument satisfies the given matcher.
| index | The index of the selected argument. |
| Matcher | The matcher type. |
| matcher | The matcher. |
| projection | Projection to apply to the argument. |
This requirement checks, whether the selected argument matches the given matcher. One argument can be checked multiple times in different requirements and all results will be combined as conjunction.
For a list of built-in matchers, see matcher section.
|
nodiscardconstexprnoexcept |
Checks whether the selected arguments satisfy the given matcher.
| first | The index of the first selected argument. |
| others | The indices of other selected arguments. |
| Matcher | The matcher type. |
| matcher | The matcher. |
| projections | Projections, the arguments will be applied on. |
This requirement checks, whether the selected arguments match the given matcher. It's useful, when multiple arguments must be checked together, because they have some kind of relationship. When n indices are provided the matcher must accept n arguments.
The projections will be applied from the beginning: E.g. if n arguments and p projections are given (with 0 <= p <= n), then the first p arguments will be applied on these projections (the i-th argument on the i-th projection).
std::identity can be used to skip arguments, which shall not be projected. For a list of built-in matchers, see matcher section.