47 ATTRIB2(
"β", int64_t(2)),
53 CHILD_T(
Time(12,34,56,78)),
55 ATTRIB_NODE =
MakeRec().genNode(
"δ"),
56 GAMMA_PI(
"γ", 3.14159265);
60 using LERR_(DIFF_CONFLICT);
87 return snapshot({ins(ATTRIB1)
112 return snapshot({after(CHILD_B)
160 struct HappyBlackHole
162 bool diligent =
true;
173 .ignoreAllChanges());
177 HappyBlackHole subject;
180 VERIFY_ERROR(DIFF_CONFLICT, application.consume(populationDiff()) );
181 VERIFY_ERROR(DIFF_CONFLICT, application.consume(reorderingDiff()) );
182 VERIFY_ERROR(DIFF_CONFLICT, application.consume(mutationDiff()) );
184 subject.diligent =
false;
186 application.consume(populationDiff());
187 application.consume(reorderingDiff());
188 application.consume(mutationDiff());
213 .change(
"γ", [&](
double val) { loot = val; }));
220 const auto NOTHING = 0.0;
221 const auto VAL_1 = ATTRIB3.data.get<
double>();
222 const auto VAL_2 = GAMMA_PI.data.get<
double>();
224 CHECK (subject.loot == NOTHING);
226 application.consume(populationDiff());
227 CHECK (subject.loot == VAL_1);
229 application.consume(reorderingDiff());
230 CHECK (subject.loot == VAL_1);
232 application.consume(mutationDiff());
233 CHECK (subject.loot == VAL_2);
Concrete implementation to apply structural changes to hierarchical data structures.
#define VERIFY_ERROR(ERROR_ID, ERRONEOUS_STATEMENT)
Macro to verify that a statement indeed raises an exception.
iter_stl::IterSnapshot< VAL > snapshot(std::initializer_list< VAL > const &&ili)
Take a snapshot of the given std::initializer_list.
Implementation namespace for support and library code.
Lumiera's internal time value datatype.
static Builder< TreeMutator > build()
DSL: start building a custom adapted tree mutator, where the operations are tied by closures or wrapp...
SUB & emplace(SUB &&implementation)
move-construct an instance of a subclass into the opaque buffer
A handle to allow for safe »remote implantation« of an unknown subclass into a given opaque InPlaceBu...
static const Ref END
symbolic ID ref "_END_"
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.
static const Ref ATTRIBS
symbolic ID ref "_ATTRIBS_"
materialised iterator contents.
Diagnostic helper for unit tests regarding mutation of custom data.
generic data element node within a tree
generic builder to apply a diff description to a given target data structure.
Customisable intermediary to abstract mutating operations on arbitrary, hierarchical object-like data...