58 ATTRIB2(
"β", int64_t(2)),
64 CHILD_T(
Time(12,34,56,78)),
66 ATTRIB_NODE =
MakeRec().genNode(
"δ"),
67 GAMMA_PI(
"γ", 3.14159265);
166 .attachDummy (target);
169 CHECK (isnil (target));
170 CHECK (not mutator.hasSrc());
172 mutator.injectNew (ATTRIB1);
173 CHECK (!isnil (target));
175 CHECK (target.verifyEvent(
"injectNew",
"α = 1")
176 .
after(
"attachMutator"));
178 mutator.injectNew (ATTRIB3);
179 mutator.injectNew (ATTRIB3);
180 mutator.injectNew (CHILD_B);
181 mutator.injectNew (CHILD_B);
182 mutator.injectNew (CHILD_T);
183 CHECK (mutator.completeScope());
184 CHECK (target.verify(
"attachMutator")
193 CHECK (target.
showContent() ==
"α = 1, γ = 3.45, γ = 3.45, b, b, 78:56:34.012");
194 cout <<
"Content after population; " 201 .attachDummy (target);
204 CHECK (target.verify(
"attachMutator")
206 .
before(
"attachMutator"));
208 CHECK (isnil (target));
209 CHECK (mutator2.hasSrc());
210 CHECK (target.
showSrcBuffer() ==
"α = 1, γ = 3.45, γ = 3.45, b, b, 78:56:34.012");
212 CHECK (mutator2.matchSrc (ATTRIB1));
213 CHECK (isnil (target));
216 CHECK (mutator2.hasSrc());
217 CHECK (!isnil (target));
218 CHECK (target.
showContent() ==
"α = 1, γ = 3.45, γ = 3.45");
219 CHECK (mutator2.matchSrc (CHILD_B));
221 mutator2.injectNew (ATTRIB2);
222 CHECK (target.
showContent() ==
"α = 1, γ = 3.45, γ = 3.45, β = 2");
226 CHECK (mutator2.hasSrc());
227 CHECK (mutator2.matchSrc (CHILD_B));
228 mutator2.skipSrc (CHILD_B);
229 mutator2.injectNew (SUB_NODE);
230 CHECK (mutator2.matchSrc (CHILD_B));
231 CHECK (not mutator2.findSrc (CHILD_A));
232 CHECK (mutator2.hasSrc());
233 CHECK (mutator2.matchSrc (CHILD_B));
234 CHECK (not mutator2.acceptSrc (CHILD_T));
235 CHECK (mutator2.matchSrc (CHILD_B));
236 CHECK (mutator2.hasSrc());
237 CHECK (mutator2.findSrc (CHILD_T));
238 CHECK (!isnil (target));
239 CHECK (target.
showContent() ==
"α = 1, γ = 3.45, γ = 3.45, β = 2, Rec(), 78:56:34.012");
241 CHECK (mutator2.matchSrc (CHILD_B));
242 CHECK (mutator2.acceptSrc (CHILD_B));
244 CHECK (mutator2.hasSrc());
245 mutator2.skipSrc (CHILD_T);
246 CHECK (target.
showContent() ==
"α = 1, γ = 3.45, γ = 3.45, β = 2, Rec(), 78:56:34.012, b");
247 CHECK (not mutator2.hasSrc());
248 CHECK (not mutator2.acceptSrc (CHILD_T));
249 CHECK (mutator2.completeScope());
250 CHECK (target.verify(
"attachMutator")
254 .
beforeEvent(
"accept_until after ATTRIBS",
"γ = 3.45")
255 .
beforeEvent(
"accept_until after ATTRIBS",
"γ = 3.45")
262 .
beforeEvent(
"completeScope",
"scope completed / 6 waste elm(s)")
264 CHECK (target.
showContent() ==
"α = 1, γ = 3.45, γ = 3.45, β = 2, Rec(), 78:56:34.012, b");
265 cout <<
"Content after reordering; " 273 .attachDummy (target);
277 CHECK (isnil (target));
278 CHECK (mutator3.matchSrc (ATTRIB1));
279 CHECK (mutator3.accept_until (CHILD_T));
280 CHECK (mutator3.matchSrc (CHILD_B));
281 CHECK (not mutator3.completeScope());
282 CHECK (mutator3.accept_until (
Ref::END));
283 CHECK ( mutator3.completeScope());
286 CHECK (not contains(target.
showContent(),
"γ = 3.1415927"));
287 CHECK (mutator3.assignElm(GAMMA_PI));
288 CHECK ( contains(target.
showContent(),
"γ = 3.1415927"));
289 CHECK ( mutator3.completeScope());
290 cout <<
"Content after assignment; " 304 CHECK (mutator3.mutateChild (SUB_NODE, placementHandle));
305 CHECK (not subMutatorBuffer->hasSrc());
310 GenNode differentTime{CHILD_T.idi.getSym(),
Time(11,22)};
311 VERIFY_ERROR (LOGIC, mutator3.assignElm (differentTime));
313 CHECK (target.
showContent() ==
"α = 1, γ = 3.1415927, γ = 3.45, β = 2, Rec(), 78:56:34.012, b");
314 CHECK (target.verifyEvent(
"findSrc",
"78:56:34.012")
316 .
before(
"attachMutator TestWireTap")
318 .
beforeEvent(
"accept_until _CHILD_Time.",
"γ = 3.45")
319 .
beforeEvent(
"accept_until _CHILD_Time.",
"γ = 3.45")
322 .
beforeEvent(
"accept_until _CHILD_Time.",
"78:56:34.012")
323 .
beforeEvent(
"completeScope",
"scope NOT completed")
325 .
beforeEvent(
"completeScope",
"scope completed / 7 waste elm(s)")
327 .
beforeEvent(
"completeScope",
"scope completed / 7 waste elm(s)")
328 .
beforeEvent(
"mutateChild",
"start mutation...Rec()")
331 cout <<
"____Mutation-Log______________\n" 332 << join(target.getLog(),
"\n")
333 <<
"\n───╼━━━━━━━━━╾────────────────"<<endl;
364 operator string()
const {
return _Fmt{
"≺%s∣%s≻"} % key % val; }
365 bool operator== (Data
const& o)
const {
return key==o.key and val==o.val; }
366 bool operator!= (Data
const& o)
const {
return not (*
this == o); }
369 using VecD = std::vector<Data>;
370 using MapD = std::map<string, VecD>;
379 .constructFrom ([&](
GenNode const& spec) -> Data
381 cout <<
"constructor invoked on "<<spec<<endl;
382 return {spec.idi.getSym(),
render(spec.data)};
385 CHECK (
sizeof(mutator1) <=
sizeof(VecD)
387 + 2 *
sizeof(VecD::iterator)
397 CHECK (isnil (target));
398 CHECK (not mutator1.hasSrc());
400 mutator1.injectNew (ATTRIB1);
401 CHECK (!isnil (target));
402 CHECK (contains(join(target),
"≺α∣1≻"));
404 mutator1.injectNew (ATTRIB3);
405 mutator1.injectNew (ATTRIB3);
406 mutator1.injectNew (CHILD_B);
407 mutator1.injectNew (CHILD_B);
408 mutator1.injectNew (CHILD_T);
409 CHECK (mutator1.completeScope());
411 auto contents = stringify(eachElm(target));
412 CHECK (
"≺α∣1≻" == *contents);
414 CHECK (
"≺γ∣3.45≻" == *contents);
416 CHECK (
"≺γ∣3.45≻" == *contents);
418 CHECK (contains(*contents,
"∣b≻"));
420 CHECK (contains(*contents,
"∣b≻"));
422 CHECK (contains(*contents,
"∣78:56:34.012≻"));
424 CHECK (isnil (contents));
426 cout <<
"injected......" << join(target) <<endl;
437 .constructFrom ([&](
GenNode const& spec) -> Data
439 cout <<
"constructor invoked on "<<spec<<endl;
440 return {spec.idi.getSym(),
render(spec.data)};
442 .matchElement ([&](
GenNode const& spec, Data
const& elm)
444 cout <<
"match? "<<spec.idi.getSym()<<
"=?="<<elm.key<<endl;
445 return spec.idi.getSym() == elm.key;
449 CHECK (
sizeof(mutator1) -
sizeof(mutator2) ==
sizeof(
void*));
452 CHECK (isnil (target));
454 CHECK (mutator2.matchSrc (ATTRIB1));
455 CHECK (isnil (target));
458 CHECK (mutator2.matchSrc (ATTRIB1));
464 CHECK (mutator2.accept_until(ATTRIB3));
465 CHECK (!isnil (target));
466 CHECK (mutator2.acceptSrc(ATTRIB3));
467 CHECK (mutator2.hasSrc());
468 CHECK (mutator2.matchSrc (CHILD_B));
469 mutator2.injectNew (ATTRIB2);
471 CHECK (mutator2.matchSrc (CHILD_B));
472 mutator2.skipSrc (CHILD_B);
473 mutator2.injectNew (SUB_NODE);
474 CHECK (mutator2.matchSrc (CHILD_B));
475 CHECK (not mutator2.findSrc (CHILD_A));
476 CHECK (mutator2.hasSrc());
477 CHECK (mutator2.matchSrc (CHILD_B));
478 CHECK (not mutator2.acceptSrc (CHILD_T));
479 CHECK (mutator2.matchSrc (CHILD_B));
480 CHECK (mutator2.hasSrc());
481 CHECK (mutator2.findSrc (CHILD_T));
482 CHECK (mutator2.matchSrc (CHILD_B));
483 CHECK (mutator2.acceptSrc (CHILD_B));
485 CHECK (mutator2.hasSrc());
486 mutator2.skipSrc (CHILD_T);
487 CHECK (not mutator2.hasSrc());
488 CHECK (not mutator2.acceptSrc (CHILD_T));
489 CHECK (mutator2.completeScope());
492 contents = stringify(eachElm(target));
493 CHECK (
"≺α∣1≻" == *contents);
495 CHECK (
"≺γ∣3.45≻" == *contents);
497 CHECK (
"≺γ∣3.45≻" == *contents);
499 CHECK (
"≺β∣2≻" == *contents);
501 CHECK (contains(*contents,
"∣Rec()≻"));
503 CHECK (contains(*contents,
"∣78:56:34.012≻"));
505 CHECK (contains(*contents,
"∣b≻"));
507 CHECK (isnil (contents));
509 cout <<
"Content after reordering...." 510 << join(target) <<endl;
524 .constructFrom ([&](
GenNode const& spec) -> Data
526 cout <<
"constructor invoked on "<<spec<<endl;
527 return {spec.idi.getSym(),
render(spec.data)};
529 .matchElement ([&](
GenNode const& spec, Data
const& elm) ->
bool 531 cout <<
"match? "<<spec.idi.getSym()<<
"=?="<<elm.key<<endl;
532 return spec.idi.getSym() == elm.key;
534 .assignElement ([&](Data& target,
GenNode const& spec) ->
bool 536 cout <<
"assign "<<target<<
" <- "<<spec<<endl;
537 CHECK (target.key == spec.idi.getSym(),
"assignment to target with wrong identity");
538 target.val =
render(spec.data);
544 VecD& subScope = subScopes[subID];
548 .constructFrom ([&](
GenNode const& spec) -> Data
550 cout <<
"SubScope| constructor invoked on "<<spec<<endl;
551 return {spec.idi.getSym(),
render(spec.data)};
556 cout <<
"openSub("<<subID.getSym()<<
") ⟻ "<<target<<endl;
557 target.val =
"Rec(--"+subID.getSym()+
"--)";
563 CHECK (isnil (target));
564 CHECK (mutator3.matchSrc (ATTRIB1));
565 CHECK (mutator3.accept_until (CHILD_T));
566 CHECK (mutator3.matchSrc (CHILD_B));
567 CHECK (not mutator3.completeScope());
568 CHECK (mutator3.accept_until (
Ref::END));
569 CHECK ( mutator3.completeScope());
571 CHECK (not contains(join(target),
"≺γ∣3.1415927≻"));
572 CHECK (mutator3.assignElm(GAMMA_PI));
573 CHECK ( contains(join(target),
"≺γ∣3.1415927≻"));
574 CHECK ( mutator3.completeScope());
575 cout <<
"Content after assignment...." 576 << join(target) <<endl;
586 CHECK (mutator3.mutateChild (SUB_NODE, placementHandle));
588 CHECK (isnil (subScopes[SUB_NODE.idi]));
589 CHECK (not subMutatorBuffer->hasSrc());
602 subMutatorBuffer->injectNew (TYPE_X);
603 subMutatorBuffer->injectNew (ATTRIB2);
604 subMutatorBuffer->injectNew (CHILD_B);
605 subMutatorBuffer->injectNew (CHILD_A);
607 CHECK (not isnil (subScopes[SUB_NODE.idi]));
608 cout <<
"Sub|" << join(subScopes[SUB_NODE.idi]) <<endl;
611 contents = stringify(eachElm(subScopes[SUB_NODE.idi]));
612 CHECK (
"≺type∣ξ≻" == *contents);
614 CHECK (
"≺β∣2≻" == *contents);
616 CHECK (contains(*contents,
"∣b≻"));
618 CHECK (contains(*contents,
"∣a≻"));
620 CHECK (isnil (contents));
625 mutator3.injectNew (ATTRIB_NODE);
626 CHECK (mutator3.mutateChild (ATTRIB_NODE, placementHandle));
627 subMutatorBuffer->injectNew (TYPE_Z);
628 subMutatorBuffer->injectNew (CHILD_A);
629 subMutatorBuffer->injectNew (CHILD_A);
630 subMutatorBuffer->injectNew (CHILD_A);
631 CHECK (subMutatorBuffer->completeScope());
632 CHECK (mutator3.completeScope());
635 cout <<
"Sub|" << join(subScopes[ATTRIB_NODE.idi]) <<endl;
638 contents = stringify(eachElm(subScopes[ATTRIB_NODE.idi]));
639 CHECK (
"≺type∣ζ≻" == *contents);
641 CHECK (contains(*contents,
"∣a≻"));
643 CHECK (contains(*contents,
"∣a≻"));
645 CHECK (contains(*contents,
"∣a≻"));
647 CHECK (isnil (contents));
652 CHECK (contains (join(target),
"Rec(--"+SUB_NODE.idi.getSym()+
"--)"));
653 CHECK (contains (join(target),
"Rec(--"+ATTRIB_NODE.idi.getSym()+
"--)"));
655 cout <<
"Content after nested mutation...." 656 << join(target) <<endl;
685 #define LOG_SETTER(KEY) cout << STRINGIFY(KEY) " := "<<val<<endl; 691 .change(
"α", [&](
int val)
696 .change(
"γ", [&](
double val)
703 CHECK (
sizeof(mutator1) <=
sizeof(
void*)
715 CHECK (not mutator1.hasSrc());
717 CHECK (mutator1.completeScope());
719 mutator1.injectNew (ATTRIB1);
724 mutator1.injectNew (ATTRIB3);
727 CHECK (3.45 == gamma);
729 mutator1.injectNew (ATTRIB3);
732 CHECK (3.45 == gamma);
734 CHECK (not mutator1.injectNew (ATTRIB2));
738 mutator1.injectNew (CHILD_B);
739 mutator1.injectNew (CHILD_B);
740 mutator1.injectNew (CHILD_T);
741 CHECK (mutator1.completeScope());
745 CHECK (3.45 == gamma);
746 cout <<
"successfully 'injected' new attributes." <<endl;
759 .change(
"α", [&](
int val)
764 .change(
"β", [&](int64_t val)
769 .change(
"γ", [&](
double val)
777 CHECK (
sizeof(mutator2) <=
sizeof(
void*)
785 CHECK (3.45 == gamma);
787 CHECK (mutator2.matchSrc (ATTRIB1));
790 CHECK (3.45 == gamma);
797 CHECK (mutator2.matchSrc (ATTRIB1));
798 CHECK (mutator2.acceptSrc (ATTRIB1));
804 CHECK (3.45 == gamma);
810 CHECK (mutator2.accept_until(
Ref::END));
812 mutator2.injectNew (ATTRIB2);
816 CHECK (3.45 == gamma);
823 CHECK (not mutator2.matchSrc (CHILD_B));
824 mutator2.skipSrc (CHILD_B);
825 CHECK (not mutator2.injectNew (SUB_NODE));
826 CHECK (not mutator2.matchSrc (CHILD_B));
827 CHECK (not mutator2.findSrc (CHILD_T));
828 CHECK (not mutator2.acceptSrc (CHILD_B));
829 mutator2.skipSrc (CHILD_T);
833 CHECK (3.45 == gamma);
835 cout <<
"ignored all 'reordering' operations (as expected)..." <<endl;
847 .change(
"γ", [&](
double val)
858 .attachDummy (delta));
862 cout <<
"openSub()...\n" 863 << join(delta.getLog(),
"\n") <<endl;
867 CHECK (
sizeof(mutator1) <=
sizeof(
void*)
874 CHECK (not mutator3.accept_until (ATTRIB2));
875 CHECK (not mutator3.accept_until (ATTRIB1));
877 CHECK (mutator3.accept_until (
Ref::END));
882 CHECK (mutator3.completeScope());
885 CHECK (not mutator3.acceptSrc (ATTRIB1));
886 CHECK (not mutator3.acceptSrc (ATTRIB2));
887 CHECK ( mutator3.acceptSrc (ATTRIB3));
888 CHECK ( mutator3.acceptSrc (ATTRIB_NODE));
891 CHECK (3.45 == gamma);
892 CHECK (mutator3.assignElm(GAMMA_PI));
893 CHECK (3.14159265 == gamma);
897 cout <<
"successfully assigned a new value." <<endl;
910 CHECK (mutator3.mutateChild (ATTRIB_NODE, placementHandle));
912 CHECK (isnil (delta));
913 CHECK (not subMutatorBuffer->hasSrc());
917 subMutatorBuffer->injectNew (TYPE_X);
918 subMutatorBuffer->injectNew (ATTRIB2);
919 subMutatorBuffer->injectNew (CHILD_B);
920 subMutatorBuffer->injectNew (CHILD_A);
922 CHECK (not isnil (delta));
924 cout <<
"____Mutation-Log(nested)______\n" 925 << join(delta.getLog(),
"\n")
926 <<
"\n───╼━━━━━━━━━╾────────────────"<<endl;
929 CHECK (delta.
showContent() ==
"type = ξ, β = 2, b, a");
932 CHECK (3.14159265 == gamma);
963 using VecG = RecordSetup<GenNode>::Storage; 965 CHECK (
sizeof(mutator1) <= 2 * (
sizeof(VecG)
967 + 2*
sizeof(VecG::iterator)
970 + 1 *
sizeof(
void*));
981 CHECK (isnil (target));
982 CHECK (not mutator1.hasSrc());
984 mutator1.injectNew (ATTRIB1);
985 CHECK (!isnil (target));
986 CHECK (contains(renderRecord(target),
"α = 1"));
988 mutator1.injectNew (ATTRIB3);
989 mutator1.injectNew (ATTRIB3);
990 mutator1.injectNew (CHILD_B);
991 mutator1.injectNew (CHILD_B);
992 mutator1.injectNew (CHILD_T);
993 CHECK (mutator1.completeScope());
997 CHECK (!isnil (root));
998 CHECK (Rec::TYPE_NIL == root.getType());
999 CHECK (1 == root.get(
"α").data.get<
int>());
1000 CHECK (3.45 == root.get(
"γ").data.get<
double>());
1001 auto scope = root.scope();
1002 CHECK ( *scope == CHILD_B);
1003 CHECK (*++scope == CHILD_B);
1004 CHECK (*++scope == CHILD_T);
1006 cout <<
"injected...................." 1007 << renderRecord(target)<<endl;
1022 CHECK (isnil (target));
1024 CHECK (mutator2.matchSrc (ATTRIB1));
1025 CHECK (isnil (target));
1027 CHECK (mutator2.accept_until(ATTRIB3));
1028 CHECK (!isnil (target));
1030 CHECK (mutator2.matchSrc (ATTRIB3));
1035 CHECK (mutator2.hasSrc());
1036 CHECK (mutator2.matchSrc (CHILD_B));
1037 mutator2.injectNew (ATTRIB2);
1039 CHECK (mutator2.matchSrc (CHILD_B));
1040 mutator2.skipSrc (CHILD_B);
1041 mutator2.injectNew (SUB_NODE);
1042 CHECK (mutator2.matchSrc (CHILD_B));
1043 CHECK (not mutator2.findSrc (CHILD_A));
1044 CHECK (mutator2.hasSrc());
1045 CHECK (mutator2.matchSrc (CHILD_B));
1046 CHECK (not mutator2.acceptSrc (CHILD_T));
1047 CHECK (mutator2.matchSrc (CHILD_B));
1048 CHECK (mutator2.hasSrc());
1049 CHECK (mutator2.findSrc (CHILD_T));
1050 CHECK (mutator2.matchSrc (CHILD_B));
1051 CHECK (mutator2.acceptSrc (CHILD_B));
1053 CHECK (mutator2.hasSrc());
1054 mutator2.skipSrc (CHILD_T);
1055 CHECK (not mutator2.hasSrc());
1056 CHECK (not mutator2.acceptSrc (CHILD_T));
1057 CHECK (mutator2.completeScope());
1060 CHECK (!isnil (root));
1061 CHECK (Rec::TYPE_NIL == root.getType());
1062 CHECK (1 == root.get(
"α").data.get<
int>());
1063 CHECK (2 == root.get(
"β").data.get<int64_t>());
1064 CHECK (3.45 == root.get(
"γ").data.get<
double>());
1065 auto attrs = root.attribs();
1066 CHECK ( *attrs == ATTRIB1);
1067 CHECK (*++attrs == ATTRIB3);
1068 CHECK (*++attrs == ATTRIB3);
1069 CHECK (*++attrs == ATTRIB2);
1070 CHECK (isnil (++attrs));
1071 scope = root.scope();
1072 CHECK ( *scope == SUB_NODE);
1073 CHECK (*++scope == CHILD_T);
1074 CHECK (*++scope == CHILD_B);
1075 CHECK (isnil (++scope));
1077 cout <<
"Content after reordering...." 1078 << renderRecord(target) <<endl;
1093 CHECK (isnil (target));
1094 CHECK (mutator3.matchSrc (ATTRIB1));
1095 CHECK (mutator3.accept_until (CHILD_T));
1096 CHECK (mutator3.matchSrc (CHILD_B));
1097 CHECK (not mutator3.completeScope());
1098 CHECK (mutator3.accept_until (
Ref::END));
1099 CHECK ( mutator3.completeScope());
1101 CHECK (not contains(renderRecord(target),
"γ = 3.1415927"));
1102 CHECK (mutator3.assignElm(GAMMA_PI));
1103 CHECK ( contains(renderRecord(target),
"γ = 3.1415927"));
1104 CHECK ( mutator3.completeScope());
1105 cout <<
"Content after assignment...." 1106 << renderRecord(target) <<endl;
1111 attrs = root.attribs();
1112 CHECK ( *attrs == ATTRIB1);
1113 CHECK (*++attrs == GAMMA_PI);
1114 CHECK ( attrs->data.get<
double>() == GAMMA_PI.data.get<
double>());
1115 CHECK (*++attrs == ATTRIB3);
1116 CHECK ( attrs->data.get<
double>() == 3.45);
1117 CHECK (*++attrs == ATTRIB2);
1118 CHECK (isnil (++attrs));
1128 CHECK (mutator3.mutateChild (SUB_NODE, placementHandle));
1130 GenNode const& subNode = *root.scope();
1131 CHECK (subNode == SUB_NODE);
1132 CHECK (isnil (subNode.data.get<
Rec>()));
1136 CHECK (not subMutatorBuffer->hasSrc());
1137 subMutatorBuffer->injectNew (TYPE_X);
1138 subMutatorBuffer->injectNew (ATTRIB2);
1139 subMutatorBuffer->injectNew (CHILD_B);
1140 subMutatorBuffer->injectNew (CHILD_A);
1142 Rec const& nestedRec = subNode.data.get<
Rec>();
1143 CHECK (not isnil (nestedRec));
1144 cout <<
"Sub-" << renderNode(subNode) <<endl;
1147 CHECK (
"ξ" == nestedRec.getType());
1148 attrs = nestedRec.attribs();
1149 CHECK ( *attrs == ATTRIB2);
1150 CHECK (isnil (++attrs));
1151 scope = nestedRec.scope();
1152 CHECK ( *scope == CHILD_B);
1153 CHECK (*++scope == CHILD_A);
1154 CHECK (isnil (++scope));
1159 mutator3.injectNew (ATTRIB_NODE);
1160 CHECK (mutator3.mutateChild (ATTRIB_NODE, placementHandle));
1161 subMutatorBuffer->injectNew (TYPE_X);
1162 subMutatorBuffer->injectNew (CHILD_A);
1163 subMutatorBuffer->injectNew (CHILD_A);
1164 subMutatorBuffer->injectNew (CHILD_A);
1165 subMutatorBuffer->assignElm (TYPE_Z);
1166 CHECK (subMutatorBuffer->completeScope());
1167 CHECK (mutator3.completeScope());
1170 Rec const& attrRec = root.get(
"δ").data.get<
Rec>();
1171 cout <<
"Att-" << renderNode(attrRec) <<endl;
1174 CHECK (not isnil (attrRec));
1175 CHECK (
"ζ" == attrRec.getType());
1176 CHECK (isnil (attrRec.attribs()));
1177 scope = attrRec.scope();
1178 CHECK (not isnil (scope));
1179 CHECK ( *scope == CHILD_A);
1180 CHECK (*++scope == CHILD_A);
1181 CHECK (*++scope == CHILD_A);
1182 CHECK (isnil (++scope));
1187 CHECK (contains (renderRecord(target), renderRecord(attrRec)));
1188 CHECK (contains (renderRecord(target), renderRecord(nestedRec)));
1190 cout <<
"Content after sub mutation.." 1191 << renderRecord(target) <<endl;
string showContent() const
render payload content for diagnostics
string render(DataCap const &)
Test adapter to watch and verify how the TreeMutator binds to custom tree data structures.
bool operator==(PtrDerefIter< I1 > const &il, PtrDerefIter< I2 > const &ir)
Supporting equality comparisons...
#define VERIFY_ERROR(ERROR_ID, ERRONEOUS_STATEMENT)
Macro to verify that a statement indeed raises an exception.
EventMatch & after(string match)
find a match (substring match) of the given text in an EventLog entry before the current position...
A front-end for using printf-style formatting.
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
string showSrcBuffer() const
render elements waiting in source buffer to be accepted
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_"
#define MARK_TEST_FUN
Macro to mark the current test function in STDOUT.
EventMatch & beforeEvent(string match)
find a match for an "event" after the current point of reference
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.
_SeqT< CON >::Range eachElm(CON &coll)
Lumiera error handling (C++ interface).
static const Ref ATTRIBS
symbolic ID ref "_ATTRIBS_"
Customisable intermediary to abstract generic tree mutation operations.
Buffer to place and maintain an object instance privately within another object.
auto collection(COLL &coll)
Entry point to a nested DSL for setup and configuration of a collection binding.
Preconfigured adapters for some STL container standard usage situations.
a family of time value like entities and their relationships.
object-like record of data.
string contents(Rec const &object)
render the child elements as string data for test/verification
Diagnostic helper for unit tests regarding mutation of custom data.
EventMatch & before(string match)
find a match (substring match) of the given text in an EventLog entry after the current position ...
generic data element node within a tree
bool contains(SEQ const &cont, typename SEQ::const_reference val)
shortcut for brute-force containment test in any sequential container