23 for (
auto const&
val : pats) {
24 cout << i <<
": " <<
val <<
endl;
32 for (
auto const&
val : cont) {
33 cout << i <<
": " <<
val <<
endl;
39 vector<EventID>
const& eids,
54 for (
auto const&
val : eids) {
56 matches.push_back(
val);
63 vector<EventID>
const& eids,
78 for (
auto const&
val : eids) {
80 matches.push_back(
val);
92 if (matches == expected) {
95 cerr <<
"Match with \"" << pat <<
"\" failed!" <<
endl;
96 cerr <<
"expected:" <<
endl;
98 cerr <<
"matches:" <<
endl;
106 vector<EventID>
const&
matches)
110 if (matches == expected) {
113 cerr <<
"Match with pattern list failed!" <<
endl;
114 cerr <<
"patterns:" <<
endl;
116 cerr <<
"expected:" <<
endl;
118 cerr <<
"matches:" <<
endl;
125 vector<EventID>
const& eids,
135 vector<EventID>
const& eids,
149 vector<EventID> eids;
151 for (
auto subrun = 0U; subrun < 2U; ++subrun) {
153 eids.emplace_back(
run, subrun,
event);
261 auto pat =
"1-2:0:1"s;
270 auto pat =
"1:0-1:1"s;
279 auto pat =
"1:0:1-2"s;
287 vector<EventID>
empty;
291 for (
auto subrun = 0U; subrun < 10U; ++subrun) {
293 eids.emplace_back(
run, subrun,
event);
299 auto pat =
"1-2, 4, 6-9 : 0 : 1"s;
313 auto pat =
"3: 1-3, 6, 9 : 5"s;
325 auto pat =
"7: 5 : 3, 5-5, 6-7, 9-10"s;
338 auto pat =
"1, 6 : 0, 2, 5-6 : 3, 6-7"s;
340 {1, 0, 3}, {1, 0, 6}, {1, 0, 7}, {1, 2, 3}, {1, 2, 6}, {1, 2, 7},
341 {1, 5, 3}, {1, 5, 6}, {1, 5, 7}, {1, 6, 3}, {1, 6, 6}, {1, 6, 7},
342 {6, 0, 3}, {6, 0, 6}, {6, 0, 7}, {6, 2, 3}, {6, 2, 6}, {6, 2, 7},
343 {6, 5, 3}, {6, 5, 6}, {6, 5, 7}, {6, 6, 3}, {6, 6, 6}, {6, 6, 7},
349 vector<string> pats = {
361 vector<string> pats = {
362 "7: 5 : 3, 5-5, 6-7, 9-10"s,
363 "1, 6 : 0, 2, 5-6 : 3, 6-7"s,
364 "1-2: 5 : 3, 5-5, 6-7, 9-10"s,
367 {1, 0, 3}, {1, 0, 6}, {1, 0, 7}, {1, 2, 3}, {1, 2, 6}, {1, 2, 7},
368 {1, 5, 3}, {1, 5, 5}, {1, 5, 6}, {1, 5, 7}, {1, 5, 9}, {1, 5, 10},
369 {1, 6, 3}, {1, 6, 6}, {1, 6, 7}, {2, 5, 3}, {2, 5, 5}, {2, 5, 6},
370 {2, 5, 7}, {2, 5, 9}, {2, 5, 10}, {6, 0, 3}, {6, 0, 6}, {6, 0, 7},
371 {6, 2, 3}, {6, 2, 6}, {6, 2, 7}, {6, 5, 3}, {6, 5, 6}, {6, 5, 7},
372 {6, 6, 3}, {6, 6, 6}, {6, 6, 7}, {7, 5, 3}, {7, 5, 5}, {7, 5, 6},
373 {7, 5, 7}, {7, 5, 9}, {7, 5, 10},
void find_matches(string const &pat, vector< EventID > const &eids, vector< EventID > &matches)
void find_list_matches(vector< string > const &pats, vector< EventID > const &eids, vector< EventID > &matches)
void run_test(string const &pat, vector< EventID > const &eids, vector< EventID > const &expected)
void check_match(string const &pat, vector< EventID > const &expected, vector< EventID > const &matches)
void check_list_match(vector< string > const &pats, vector< EventID > const &expected, vector< EventID > const &matches)
void dump_pats(vector< string > const &pats)
void dump_ids(vector< EventID > const &cont)
void run_list_test(vector< string > const &pats, vector< EventID > const &eids, vector< EventID > const &expected)
decltype(auto) constexpr empty(T &&obj)
ADL-aware version of std::empty.
QTextStream & endl(QTextStream &s)
Event finding and building.