| 3228 | ContainsMatcher(std::vector<T> const &comparator) : m_comparator( comparator ) {} |
| 3229 | |
| 3230 | bool match(std::vector<T> const &v) const override { |
| 3231 | // !TBD: see note in EqualsMatcher |
| 3232 | if (m_comparator.size() > v.size()) |
| 3233 | return false; |
| 3234 | for (auto const& comparator : m_comparator) { |
| 3235 | auto present = false; |
| 3236 | for (const auto& el : v) { |
| 3237 | if (el == comparator) { |
| 3238 | present = true; |
| 3239 | break; |
| 3240 | } |
| 3241 | } |
| 3242 | if (!present) { |
| 3243 | return false; |
| 3244 | } |
| 3245 | } |
| 3246 | return true; |
| 3247 | } |
| 3248 | std::string describe() const override { |
| 3249 | return "Contains: " + ::Catch::Detail::stringify( m_comparator ); |
| 3250 | } |