77 .change(
"data", [&](
string val)
79 cout <<
"\"data\" closure received something "<<val<<endl;
83 cout <<
"concrete TreeMutator size=" <<
sizeof(mutator)
84 <<
" type="<< typeStr(mutator)
89 CHECK (isnil (localData));
90 string testValue{
"that would be acceptable"};
91 mutator.assignElm ({
"lore", testValue});
92 CHECK ( isnil (localData));
93 mutator.assignElm ({
"data", testValue});
94 CHECK (!isnil (localData));
95 cout <<
"localData changed to: "<<localData<<endl;
96 CHECK (localData ==
"that would be acceptable");
104 vector<string> values;
105 values.push_back(
"a");
106 values.push_back(
"b");
108 cout << join(values) <<endl;
109 CHECK (2 == values.size());
110 CHECK (
"a, b" == join(values));
114 .attach (collection(values));
116 cout <<
"concrete TreeMutator size=" <<
sizeof(mutator)
117 <<
" type="<< typeStr(mutator)
122 CHECK (isnil (values));
123 CHECK (mutator.matchSrc (
GenNode(
"a")));
124 mutator.skipSrc (
GenNode(
"a"));
125 CHECK (mutator.matchSrc (
GenNode(
"b")));
126 CHECK (mutator.injectNew (
GenNode(
"c")));
127 CHECK (mutator.acceptSrc (
GenNode(
"b")));
129 cout << join(values) <<endl;
130 CHECK (2 == values.size());
131 CHECK (
"c, b" == join(values));
static Builder< TreeMutator > build()
DSL: start building a custom adapted tree mutator, where the operations are tied by closures or wrapp...
void simpleCollectionBinding()
void simpleAttributeBinding()
Implementation namespace for support and library code.
Test runner and basic definitions for tests.
string join(COLL &&coll, string const &delim=", ")
enumerate a collection's contents, separated by delimiter.
bool isnil(lib::time::Duration const &dur)
Simplistic test class runner.
#define LAUNCHER(_TEST_CLASS_, _GROUPS_)
generic data element node within a tree
A collection of frequently used helper functions to support unit testing.
#define MARK_TEST_FUN
Macro to mark the current test function in STDOUT.
Customisable intermediary to abstract generic tree mutation operations.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...