MCPcopy Create free account
hub / github.com/ChaiScript/ChaiScript / match

Method match

unittests/catch.hpp:2571–2588  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2569 ContainsMatcher(std::vector<T> const &comparator) : m_comparator( comparator ) {}
2570
2571 bool match(std::vector<T> const &v) const override {
2572 // !TBD: see note in EqualsMatcher
2573 if (m_comparator.size() > v.size())
2574 return false;
2575 for (auto const& comparator : m_comparator) {
2576 auto present = false;
2577 for (const auto& el : v) {
2578 if (el == comparator) {
2579 present = true;
2580 break;
2581 }
2582 }
2583 if (!present) {
2584 return false;
2585 }
2586 }
2587 return true;
2588 }
2589 std::string describe() const override {
2590 return "Contains: " + ::Catch::Detail::stringify( m_comparator );
2591 }

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected