#include "test_support.hpp"
int main() {
  auto batch = samples();
  require(orders::matchingIds(batch, "Deliver") == std::vector<int>{1},
          "filter open titles");
  require(orders::matchingIds({}, "").empty(), "empty input");
  require(orders::matchingIds(batch, "absent").empty(), "no match");
  auto owned = orders::matchingIds(batch, "");
  batch.clear();
  require(owned == std::vector<int>({1, 2}), "returned IDs own their memory");
  std::cout << "ranges and ownership checks passed\n";
}
