48 using util::startsWith;
53 using LERR_(ITER_EXHAUST);
58 using Spam = vector<string>;
60 const Spam SPAM{
"spam" 77 return util::join (std::forward<II> (ii),
"-");
125 CHECK (not isnil(search));
126 CHECK (
"tomato" == *search);
127 CHECK (isSameObject (*search, SPAM[6]));
129 search.clearFilter();
130 CHECK (
"tomato" == *search);
132 CHECK (
"and" == *search);
133 search.search(
"spam");
134 CHECK (
"spam" == *search);
135 CHECK (isSameObject (*search, SPAM[8]));
139 CHECK (isnil (search));
156 .search([](
string const& str){
return startsWith (str,
"s"); });
158 CHECK (
materialise (search) ==
"spam-sausage-spam-spam-spam-spam");
159 CHECK (
"spam" == *search);
161 search.addStep([](
auto&
filter)
164 filter.setNewFilter ([=](
string const& val)
166 return val != currVal;
170 CHECK (
"sausage" == *search);
172 ==
"sausage-bacon-tomato-and-" 173 "spam-spam-bacon-spam-tomato-and-spam-" 193 using Cursor =
IterCursor<decltype(SPAM.begin())>;
195 auto search =
chainSearch(Cursor{SPAM.begin(), SPAM.end()})
213 "tomato-bacon-sausage-" auto chainSearch(SRC &&srcData)
setup a chain search configuration by suitably wrapping the given container.
bool filter(Placement< DummyMO > const &candidate)
a filter predicate to pick some objects from a resultset.
#define VERIFY_ERROR(ERROR_ID, ERRONEOUS_STATEMENT)
Macro to verify that a statement indeed raises an exception.
An iterator with the ability to switch direction.
Implementation namespace for support and library code.
Evaluation mechanism to apply a sequence of conditions onto a linear search.
Simple test class runner.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
A collection of frequently used helper functions to support unit testing.
A cursor-like iterator with the ability to switch iteration direction.
string materialise(II &&ii)
Diagnostic helper: join all the elements from a copy of the iterator.
bool isSameObject(A const &a, B const &b)
compare plain object identity, bypassing any custom comparison operators.