| 3203 | |
| 3204 | template<typename T> |
| 3205 | struct ContainsElementMatcher : MatcherBase<std::vector<T>> { |
| 3206 | |
| 3207 | ContainsElementMatcher(T const &comparator) : m_comparator( comparator) {} |
| 3208 | |
| 3209 | bool match(std::vector<T> const &v) const override { |
| 3210 | for (auto const& el : v) { |
| 3211 | if (el == m_comparator) { |
| 3212 | return true; |
| 3213 | } |
| 3214 | } |
| 3215 | return false; |
| 3216 | } |
| 3217 | |
| 3218 | std::string describe() const override { |
| 3219 | return "Contains: " + ::Catch::Detail::stringify( m_comparator ); |
| 3220 | } |
| 3221 | |
| 3222 | T const& m_comparator; |
| 3223 | }; |
| 3224 | |
| 3225 | template<typename T> |
| 3226 | struct ContainsMatcher : MatcherBase<std::vector<T>> { |
nothing calls this directly
no outgoing calls
no test coverage detected