56 ATTRIB2(
"β", int64_t(2)),
62 CHILD_T(
Time(12,34,56,78)),
64 ATTRIB_NODE =
MakeRec().genNode(
"δ"),
65 GAMMA_PI(
"γ", 3.14159265);
69 using LERR_(DIFF_CONFLICT);
96 return snapshot({ins(ATTRIB1)
121 return snapshot({after(CHILD_B)
169 struct HappyBlackHole
171 bool diligent =
true;
182 .ignoreAllChanges());
186 HappyBlackHole subject;
189 VERIFY_ERROR(DIFF_CONFLICT, application.consume(populationDiff()) );
190 VERIFY_ERROR(DIFF_CONFLICT, application.consume(reorderingDiff()) );
191 VERIFY_ERROR(DIFF_CONFLICT, application.consume(mutationDiff()) );
193 subject.diligent =
false;
195 application.consume(populationDiff());
196 application.consume(reorderingDiff());
197 application.consume(mutationDiff());
222 .change(
"γ", [&](
double val) { loot = val; }));
229 const auto NOTHING = 0.0;
230 const auto VAL_1 = ATTRIB3.data.get<
double>();
231 const auto VAL_2 = GAMMA_PI.data.get<
double>();
233 CHECK (subject.loot == NOTHING);
235 application.consume(populationDiff());
236 CHECK (subject.loot == VAL_1);
238 application.consume(reorderingDiff());
239 CHECK (subject.loot == VAL_1);
241 application.consume(mutationDiff());
242 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_"
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.
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...