39 using util::startsWith;
44 using LERR_(ITER_EXHAUST);
49 using Spam = vector<string>;
51 const Spam SPAM{
"spam" 68 return util::join (std::forward<II> (ii),
"-");
116 CHECK (not isnil(search));
117 CHECK (
"tomato" == *search);
118 CHECK (isSameObject (*search, SPAM[6]));
120 search.clearFilter();
121 CHECK (
"tomato" == *search);
123 CHECK (
"and" == *search);
124 search.search(
"spam");
125 CHECK (
"spam" == *search);
126 CHECK (isSameObject (*search, SPAM[8]));
130 CHECK (isnil (search));
147 .search([](
string const& str){
return startsWith (str,
"s"); });
149 CHECK (
materialise (search) ==
"spam-sausage-spam-spam-spam-spam");
150 CHECK (
"spam" == *search);
152 search.addStep([](
auto&
filter)
155 filter.setNewFilter ([=](
string const& val)
157 return val != currVal;
161 CHECK (
"sausage" == *search);
163 ==
"sausage-bacon-tomato-and-" 164 "spam-spam-bacon-spam-tomato-and-spam-" 184 using Cursor =
IterCursor<decltype(SPAM.begin())>;
186 auto search =
chainSearch(Cursor{SPAM.begin(), SPAM.end()})
204 "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.
Simplistic 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, based directly on the referee's memory identities. ...