67 ATTRIB2(
"β", int64_t(2)),
73 CHILD_T(
Time(12,34,56,78)),
75 ATTRIB_NODE =
MakeRec().genNode(
"δ"),
76 GAMMA_PI(
"γ", 3.14159265);
175 .attachDummy (target);
178 CHECK (isnil (target));
179 CHECK (not mutator.hasSrc());
181 mutator.injectNew (ATTRIB1);
182 CHECK (!isnil (target));
184 CHECK (target.verifyEvent(
"injectNew",
"α = 1")
185 .
after(
"attachMutator"));
187 mutator.injectNew (ATTRIB3);
188 mutator.injectNew (ATTRIB3);
189 mutator.injectNew (CHILD_B);
190 mutator.injectNew (CHILD_B);
191 mutator.injectNew (CHILD_T);
192 CHECK (mutator.completeScope());
193 CHECK (target.verify(
"attachMutator")
202 CHECK (target.
showContent() ==
"α = 1, γ = 3.45, γ = 3.45, b, b, 78:56:34.012");
203 cout <<
"Content after population; " 210 .attachDummy (target);
213 CHECK (target.verify(
"attachMutator")
215 .
before(
"attachMutator"));
217 CHECK (isnil (target));
218 CHECK (mutator2.hasSrc());
219 CHECK (target.
showSrcBuffer() ==
"α = 1, γ = 3.45, γ = 3.45, b, b, 78:56:34.012");
221 CHECK (mutator2.matchSrc (ATTRIB1));
222 CHECK (isnil (target));
225 CHECK (mutator2.hasSrc());
226 CHECK (!isnil (target));
227 CHECK (target.
showContent() ==
"α = 1, γ = 3.45, γ = 3.45");
228 CHECK (mutator2.matchSrc (CHILD_B));
230 mutator2.injectNew (ATTRIB2);
231 CHECK (target.
showContent() ==
"α = 1, γ = 3.45, γ = 3.45, β = 2");
235 CHECK (mutator2.hasSrc());
236 CHECK (mutator2.matchSrc (CHILD_B));
237 mutator2.skipSrc (CHILD_B);
238 mutator2.injectNew (SUB_NODE);
239 CHECK (mutator2.matchSrc (CHILD_B));
240 CHECK (not mutator2.findSrc (CHILD_A));
241 CHECK (mutator2.hasSrc());
242 CHECK (mutator2.matchSrc (CHILD_B));
243 CHECK (not mutator2.acceptSrc (CHILD_T));
244 CHECK (mutator2.matchSrc (CHILD_B));
245 CHECK (mutator2.hasSrc());
246 CHECK (mutator2.findSrc (CHILD_T));
247 CHECK (!isnil (target));
248 CHECK (target.
showContent() ==
"α = 1, γ = 3.45, γ = 3.45, β = 2, Rec(), 78:56:34.012");
250 CHECK (mutator2.matchSrc (CHILD_B));
251 CHECK (mutator2.acceptSrc (CHILD_B));
253 CHECK (mutator2.hasSrc());
254 mutator2.skipSrc (CHILD_T);
255 CHECK (target.
showContent() ==
"α = 1, γ = 3.45, γ = 3.45, β = 2, Rec(), 78:56:34.012, b");
256 CHECK (not mutator2.hasSrc());
257 CHECK (not mutator2.acceptSrc (CHILD_T));
258 CHECK (mutator2.completeScope());
259 CHECK (target.verify(
"attachMutator")
263 .
beforeEvent(
"accept_until after ATTRIBS",
"γ = 3.45")
264 .
beforeEvent(
"accept_until after ATTRIBS",
"γ = 3.45")
271 .
beforeEvent(
"completeScope",
"scope completed / 6 waste elm(s)")
273 CHECK (target.
showContent() ==
"α = 1, γ = 3.45, γ = 3.45, β = 2, Rec(), 78:56:34.012, b");
274 cout <<
"Content after reordering; " 282 .attachDummy (target);
286 CHECK (isnil (target));
287 CHECK (mutator3.matchSrc (ATTRIB1));
288 CHECK (mutator3.accept_until (CHILD_T));
289 CHECK (mutator3.matchSrc (CHILD_B));
290 CHECK (not mutator3.completeScope());
291 CHECK (mutator3.accept_until (
Ref::END));
292 CHECK ( mutator3.completeScope());
295 CHECK (not contains(target.
showContent(),
"γ = 3.1415927"));
296 CHECK (mutator3.assignElm(GAMMA_PI));
297 CHECK ( contains(target.
showContent(),
"γ = 3.1415927"));
298 CHECK ( mutator3.completeScope());
299 cout <<
"Content after assignment; " 313 CHECK (mutator3.mutateChild (SUB_NODE, placementHandle));
314 CHECK (not subMutatorBuffer->hasSrc());
319 GenNode differentTime{CHILD_T.idi.getSym(),
Time(11,22)};
320 VERIFY_ERROR (LOGIC, mutator3.assignElm (differentTime));
322 CHECK (target.
showContent() ==
"α = 1, γ = 3.1415927, γ = 3.45, β = 2, Rec(), 78:56:34.012, b");
323 CHECK (target.verifyEvent(
"findSrc",
"78:56:34.012")
325 .
before(
"attachMutator TestWireTap")
327 .
beforeEvent(
"accept_until _CHILD_Time.",
"γ = 3.45")
328 .
beforeEvent(
"accept_until _CHILD_Time.",
"γ = 3.45")
331 .
beforeEvent(
"accept_until _CHILD_Time.",
"78:56:34.012")
332 .
beforeEvent(
"completeScope",
"scope NOT completed")
334 .
beforeEvent(
"completeScope",
"scope completed / 7 waste elm(s)")
336 .
beforeEvent(
"completeScope",
"scope completed / 7 waste elm(s)")
337 .
beforeEvent(
"mutateChild",
"start mutation...Rec()")
340 cout <<
"____Mutation-Log______________\n" 341 << join(target.getLog(),
"\n")
342 <<
"\n───╼━━━━━━━━━╾────────────────"<<endl;
373 operator string()
const {
return _Fmt{
"≺%s∣%s≻"} % key % val; }
374 bool operator== (Data
const& o)
const {
return key==o.key and val==o.val; }
375 bool operator!= (Data
const& o)
const {
return not (*
this == o); }
378 using VecD = std::vector<Data>;
379 using MapD = std::map<string, VecD>;
388 .constructFrom ([&](
GenNode const& spec) -> Data
390 cout <<
"constructor invoked on "<<spec<<endl;
391 return {spec.idi.getSym(),
render(spec.data)};
394 CHECK (
sizeof(mutator1) <=
sizeof(VecD)
396 + 2 *
sizeof(VecD::iterator)
406 CHECK (isnil (target));
407 CHECK (not mutator1.hasSrc());
409 mutator1.injectNew (ATTRIB1);
410 CHECK (!isnil (target));
411 CHECK (contains(join(target),
"≺α∣1≻"));
413 mutator1.injectNew (ATTRIB3);
414 mutator1.injectNew (ATTRIB3);
415 mutator1.injectNew (CHILD_B);
416 mutator1.injectNew (CHILD_B);
417 mutator1.injectNew (CHILD_T);
418 CHECK (mutator1.completeScope());
420 auto contents = stringify(eachElm(target));
421 CHECK (
"≺α∣1≻" == *contents);
423 CHECK (
"≺γ∣3.45≻" == *contents);
425 CHECK (
"≺γ∣3.45≻" == *contents);
427 CHECK (contains(*contents,
"∣b≻"));
429 CHECK (contains(*contents,
"∣b≻"));
431 CHECK (contains(*contents,
"∣78:56:34.012≻"));
433 CHECK (isnil (contents));
435 cout <<
"injected......" << join(target) <<endl;
446 .constructFrom ([&](
GenNode const& spec) -> Data
448 cout <<
"constructor invoked on "<<spec<<endl;
449 return {spec.idi.getSym(),
render(spec.data)};
451 .matchElement ([&](
GenNode const& spec, Data
const& elm)
453 cout <<
"match? "<<spec.idi.getSym()<<
"=?="<<elm.key<<endl;
454 return spec.idi.getSym() == elm.key;
458 CHECK (
sizeof(mutator1) -
sizeof(mutator2) ==
sizeof(
void*));
461 CHECK (isnil (target));
463 CHECK (mutator2.matchSrc (ATTRIB1));
464 CHECK (isnil (target));
467 CHECK (mutator2.matchSrc (ATTRIB1));
473 CHECK (mutator2.accept_until(ATTRIB3));
474 CHECK (!isnil (target));
475 CHECK (mutator2.acceptSrc(ATTRIB3));
476 CHECK (mutator2.hasSrc());
477 CHECK (mutator2.matchSrc (CHILD_B));
478 mutator2.injectNew (ATTRIB2);
480 CHECK (mutator2.matchSrc (CHILD_B));
481 mutator2.skipSrc (CHILD_B);
482 mutator2.injectNew (SUB_NODE);
483 CHECK (mutator2.matchSrc (CHILD_B));
484 CHECK (not mutator2.findSrc (CHILD_A));
485 CHECK (mutator2.hasSrc());
486 CHECK (mutator2.matchSrc (CHILD_B));
487 CHECK (not mutator2.acceptSrc (CHILD_T));
488 CHECK (mutator2.matchSrc (CHILD_B));
489 CHECK (mutator2.hasSrc());
490 CHECK (mutator2.findSrc (CHILD_T));
491 CHECK (mutator2.matchSrc (CHILD_B));
492 CHECK (mutator2.acceptSrc (CHILD_B));
494 CHECK (mutator2.hasSrc());
495 mutator2.skipSrc (CHILD_T);
496 CHECK (not mutator2.hasSrc());
497 CHECK (not mutator2.acceptSrc (CHILD_T));
498 CHECK (mutator2.completeScope());
501 contents = stringify(eachElm(target));
502 CHECK (
"≺α∣1≻" == *contents);
504 CHECK (
"≺γ∣3.45≻" == *contents);
506 CHECK (
"≺γ∣3.45≻" == *contents);
508 CHECK (
"≺β∣2≻" == *contents);
510 CHECK (contains(*contents,
"∣Rec()≻"));
512 CHECK (contains(*contents,
"∣78:56:34.012≻"));
514 CHECK (contains(*contents,
"∣b≻"));
516 CHECK (isnil (contents));
518 cout <<
"Content after reordering...." 519 << join(target) <<endl;
533 .constructFrom ([&](
GenNode const& spec) -> Data
535 cout <<
"constructor invoked on "<<spec<<endl;
536 return {spec.idi.getSym(),
render(spec.data)};
538 .matchElement ([&](
GenNode const& spec, Data
const& elm) ->
bool 540 cout <<
"match? "<<spec.idi.getSym()<<
"=?="<<elm.key<<endl;
541 return spec.idi.getSym() == elm.key;
543 .assignElement ([&](Data& target,
GenNode const& spec) ->
bool 545 cout <<
"assign "<<target<<
" <- "<<spec<<endl;
546 CHECK (target.key == spec.idi.getSym(),
"assignment to target with wrong identity");
547 target.val =
render(spec.data);
553 VecD& subScope = subScopes[subID];
557 .constructFrom ([&](
GenNode const& spec) -> Data
559 cout <<
"SubScope| constructor invoked on "<<spec<<endl;
560 return {spec.idi.getSym(),
render(spec.data)};
565 cout <<
"openSub("<<subID.getSym()<<
") ⟻ "<<target<<endl;
566 target.val =
"Rec(--"+subID.getSym()+
"--)";
572 CHECK (isnil (target));
573 CHECK (mutator3.matchSrc (ATTRIB1));
574 CHECK (mutator3.accept_until (CHILD_T));
575 CHECK (mutator3.matchSrc (CHILD_B));
576 CHECK (not mutator3.completeScope());
577 CHECK (mutator3.accept_until (
Ref::END));
578 CHECK ( mutator3.completeScope());
580 CHECK (not contains(join(target),
"≺γ∣3.1415927≻"));
581 CHECK (mutator3.assignElm(GAMMA_PI));
582 CHECK ( contains(join(target),
"≺γ∣3.1415927≻"));
583 CHECK ( mutator3.completeScope());
584 cout <<
"Content after assignment...." 585 << join(target) <<endl;
595 CHECK (mutator3.mutateChild (SUB_NODE, placementHandle));
597 CHECK (isnil (subScopes[SUB_NODE.idi]));
598 CHECK (not subMutatorBuffer->hasSrc());
611 subMutatorBuffer->injectNew (TYPE_X);
612 subMutatorBuffer->injectNew (ATTRIB2);
613 subMutatorBuffer->injectNew (CHILD_B);
614 subMutatorBuffer->injectNew (CHILD_A);
616 CHECK (not isnil (subScopes[SUB_NODE.idi]));
617 cout <<
"Sub|" << join(subScopes[SUB_NODE.idi]) <<endl;
620 contents = stringify(eachElm(subScopes[SUB_NODE.idi]));
621 CHECK (
"≺type∣ξ≻" == *contents);
623 CHECK (
"≺β∣2≻" == *contents);
625 CHECK (contains(*contents,
"∣b≻"));
627 CHECK (contains(*contents,
"∣a≻"));
629 CHECK (isnil (contents));
634 mutator3.injectNew (ATTRIB_NODE);
635 CHECK (mutator3.mutateChild (ATTRIB_NODE, placementHandle));
636 subMutatorBuffer->injectNew (TYPE_Z);
637 subMutatorBuffer->injectNew (CHILD_A);
638 subMutatorBuffer->injectNew (CHILD_A);
639 subMutatorBuffer->injectNew (CHILD_A);
640 CHECK (subMutatorBuffer->completeScope());
641 CHECK (mutator3.completeScope());
644 cout <<
"Sub|" << join(subScopes[ATTRIB_NODE.idi]) <<endl;
647 contents = stringify(eachElm(subScopes[ATTRIB_NODE.idi]));
648 CHECK (
"≺type∣ζ≻" == *contents);
650 CHECK (contains(*contents,
"∣a≻"));
652 CHECK (contains(*contents,
"∣a≻"));
654 CHECK (contains(*contents,
"∣a≻"));
656 CHECK (isnil (contents));
661 CHECK (contains (join(target),
"Rec(--"+SUB_NODE.idi.getSym()+
"--)"));
662 CHECK (contains (join(target),
"Rec(--"+ATTRIB_NODE.idi.getSym()+
"--)"));
664 cout <<
"Content after nested mutation...." 665 << join(target) <<endl;
694 #define LOG_SETTER(KEY) cout << STRINGIFY(KEY) " := "<<val<<endl; 700 .change(
"α", [&](
int val)
705 .change(
"γ", [&](
double val)
712 CHECK (
sizeof(mutator1) <=
sizeof(
void*)
724 CHECK (not mutator1.hasSrc());
726 CHECK (mutator1.completeScope());
728 mutator1.injectNew (ATTRIB1);
733 mutator1.injectNew (ATTRIB3);
736 CHECK (3.45 == gamma);
738 mutator1.injectNew (ATTRIB3);
741 CHECK (3.45 == gamma);
743 CHECK (not mutator1.injectNew (ATTRIB2));
747 mutator1.injectNew (CHILD_B);
748 mutator1.injectNew (CHILD_B);
749 mutator1.injectNew (CHILD_T);
750 CHECK (mutator1.completeScope());
754 CHECK (3.45 == gamma);
755 cout <<
"successfully 'injected' new attributes." <<endl;
768 .change(
"α", [&](
int val)
773 .change(
"β", [&](int64_t val)
778 .change(
"γ", [&](
double val)
786 CHECK (
sizeof(mutator2) <=
sizeof(
void*)
794 CHECK (3.45 == gamma);
796 CHECK (mutator2.matchSrc (ATTRIB1));
799 CHECK (3.45 == gamma);
806 CHECK (mutator2.matchSrc (ATTRIB1));
807 CHECK (mutator2.acceptSrc (ATTRIB1));
813 CHECK (3.45 == gamma);
819 CHECK (mutator2.accept_until(
Ref::END));
821 mutator2.injectNew (ATTRIB2);
825 CHECK (3.45 == gamma);
832 CHECK (not mutator2.matchSrc (CHILD_B));
833 mutator2.skipSrc (CHILD_B);
834 CHECK (not mutator2.injectNew (SUB_NODE));
835 CHECK (not mutator2.matchSrc (CHILD_B));
836 CHECK (not mutator2.findSrc (CHILD_T));
837 CHECK (not mutator2.acceptSrc (CHILD_B));
838 mutator2.skipSrc (CHILD_T);
842 CHECK (3.45 == gamma);
844 cout <<
"ignored all 'reordering' operations (as expected)..." <<endl;
856 .change(
"γ", [&](
double val)
867 .attachDummy (delta));
871 cout <<
"openSub()...\n" 872 << join(delta.getLog(),
"\n") <<endl;
876 CHECK (
sizeof(mutator1) <=
sizeof(
void*)
883 CHECK (not mutator3.accept_until (ATTRIB2));
884 CHECK (not mutator3.accept_until (ATTRIB1));
886 CHECK (mutator3.accept_until (
Ref::END));
891 CHECK (mutator3.completeScope());
894 CHECK (not mutator3.acceptSrc (ATTRIB1));
895 CHECK (not mutator3.acceptSrc (ATTRIB2));
896 CHECK ( mutator3.acceptSrc (ATTRIB3));
897 CHECK ( mutator3.acceptSrc (ATTRIB_NODE));
900 CHECK (3.45 == gamma);
901 CHECK (mutator3.assignElm(GAMMA_PI));
902 CHECK (3.14159265 == gamma);
906 cout <<
"successfully assigned a new value." <<endl;
919 CHECK (mutator3.mutateChild (ATTRIB_NODE, placementHandle));
921 CHECK (isnil (delta));
922 CHECK (not subMutatorBuffer->hasSrc());
926 subMutatorBuffer->injectNew (TYPE_X);
927 subMutatorBuffer->injectNew (ATTRIB2);
928 subMutatorBuffer->injectNew (CHILD_B);
929 subMutatorBuffer->injectNew (CHILD_A);
931 CHECK (not isnil (delta));
933 cout <<
"____Mutation-Log(nested)______\n" 934 << join(delta.getLog(),
"\n")
935 <<
"\n───╼━━━━━━━━━╾────────────────"<<endl;
938 CHECK (delta.
showContent() ==
"type = ξ, β = 2, b, a");
941 CHECK (3.14159265 == gamma);
972 using VecG = RecordSetup<GenNode>::Storage; 974 CHECK (
sizeof(mutator1) <= 2 * (
sizeof(VecG)
976 + 2*
sizeof(VecG::iterator)
979 + 1 *
sizeof(
void*));
990 CHECK (isnil (target));
991 CHECK (not mutator1.hasSrc());
993 mutator1.injectNew (ATTRIB1);
994 CHECK (!isnil (target));
995 CHECK (contains(renderRecord(target),
"α = 1"));
997 mutator1.injectNew (ATTRIB3);
998 mutator1.injectNew (ATTRIB3);
999 mutator1.injectNew (CHILD_B);
1000 mutator1.injectNew (CHILD_B);
1001 mutator1.injectNew (CHILD_T);
1002 CHECK (mutator1.completeScope());
1006 CHECK (!isnil (root));
1007 CHECK (Rec::TYPE_NIL == root.getType());
1008 CHECK (1 == root.get(
"α").data.get<
int>());
1009 CHECK (3.45 == root.get(
"γ").data.get<
double>());
1010 auto scope = root.scope();
1011 CHECK ( *scope == CHILD_B);
1012 CHECK (*++scope == CHILD_B);
1013 CHECK (*++scope == CHILD_T);
1015 cout <<
"injected...................." 1016 << renderRecord(target)<<endl;
1031 CHECK (isnil (target));
1033 CHECK (mutator2.matchSrc (ATTRIB1));
1034 CHECK (isnil (target));
1036 CHECK (mutator2.accept_until(ATTRIB3));
1037 CHECK (!isnil (target));
1039 CHECK (mutator2.matchSrc (ATTRIB3));
1044 CHECK (mutator2.hasSrc());
1045 CHECK (mutator2.matchSrc (CHILD_B));
1046 mutator2.injectNew (ATTRIB2);
1048 CHECK (mutator2.matchSrc (CHILD_B));
1049 mutator2.skipSrc (CHILD_B);
1050 mutator2.injectNew (SUB_NODE);
1051 CHECK (mutator2.matchSrc (CHILD_B));
1052 CHECK (not mutator2.findSrc (CHILD_A));
1053 CHECK (mutator2.hasSrc());
1054 CHECK (mutator2.matchSrc (CHILD_B));
1055 CHECK (not mutator2.acceptSrc (CHILD_T));
1056 CHECK (mutator2.matchSrc (CHILD_B));
1057 CHECK (mutator2.hasSrc());
1058 CHECK (mutator2.findSrc (CHILD_T));
1059 CHECK (mutator2.matchSrc (CHILD_B));
1060 CHECK (mutator2.acceptSrc (CHILD_B));
1062 CHECK (mutator2.hasSrc());
1063 mutator2.skipSrc (CHILD_T);
1064 CHECK (not mutator2.hasSrc());
1065 CHECK (not mutator2.acceptSrc (CHILD_T));
1066 CHECK (mutator2.completeScope());
1069 CHECK (!isnil (root));
1070 CHECK (Rec::TYPE_NIL == root.getType());
1071 CHECK (1 == root.get(
"α").data.get<
int>());
1072 CHECK (2 == root.get(
"β").data.get<int64_t>());
1073 CHECK (3.45 == root.get(
"γ").data.get<
double>());
1074 auto attrs = root.attribs();
1075 CHECK ( *attrs == ATTRIB1);
1076 CHECK (*++attrs == ATTRIB3);
1077 CHECK (*++attrs == ATTRIB3);
1078 CHECK (*++attrs == ATTRIB2);
1079 CHECK (isnil (++attrs));
1080 scope = root.scope();
1081 CHECK ( *scope == SUB_NODE);
1082 CHECK (*++scope == CHILD_T);
1083 CHECK (*++scope == CHILD_B);
1084 CHECK (isnil (++scope));
1086 cout <<
"Content after reordering...." 1087 << renderRecord(target) <<endl;
1102 CHECK (isnil (target));
1103 CHECK (mutator3.matchSrc (ATTRIB1));
1104 CHECK (mutator3.accept_until (CHILD_T));
1105 CHECK (mutator3.matchSrc (CHILD_B));
1106 CHECK (not mutator3.completeScope());
1107 CHECK (mutator3.accept_until (
Ref::END));
1108 CHECK ( mutator3.completeScope());
1110 CHECK (not contains(renderRecord(target),
"γ = 3.1415927"));
1111 CHECK (mutator3.assignElm(GAMMA_PI));
1112 CHECK ( contains(renderRecord(target),
"γ = 3.1415927"));
1113 CHECK ( mutator3.completeScope());
1114 cout <<
"Content after assignment...." 1115 << renderRecord(target) <<endl;
1120 attrs = root.attribs();
1121 CHECK ( *attrs == ATTRIB1);
1122 CHECK (*++attrs == GAMMA_PI);
1123 CHECK ( attrs->data.get<
double>() == GAMMA_PI.data.get<
double>());
1124 CHECK (*++attrs == ATTRIB3);
1125 CHECK ( attrs->data.get<
double>() == 3.45);
1126 CHECK (*++attrs == ATTRIB2);
1127 CHECK (isnil (++attrs));
1137 CHECK (mutator3.mutateChild (SUB_NODE, placementHandle));
1139 GenNode const& subNode = *root.scope();
1140 CHECK (subNode == SUB_NODE);
1141 CHECK (isnil (subNode.data.get<
Rec>()));
1145 CHECK (not subMutatorBuffer->hasSrc());
1146 subMutatorBuffer->injectNew (TYPE_X);
1147 subMutatorBuffer->injectNew (ATTRIB2);
1148 subMutatorBuffer->injectNew (CHILD_B);
1149 subMutatorBuffer->injectNew (CHILD_A);
1151 Rec const& nestedRec = subNode.data.get<
Rec>();
1152 CHECK (not isnil (nestedRec));
1153 cout <<
"Sub-" << renderNode(subNode) <<endl;
1156 CHECK (
"ξ" == nestedRec.getType());
1157 attrs = nestedRec.attribs();
1158 CHECK ( *attrs == ATTRIB2);
1159 CHECK (isnil (++attrs));
1160 scope = nestedRec.scope();
1161 CHECK ( *scope == CHILD_B);
1162 CHECK (*++scope == CHILD_A);
1163 CHECK (isnil (++scope));
1168 mutator3.injectNew (ATTRIB_NODE);
1169 CHECK (mutator3.mutateChild (ATTRIB_NODE, placementHandle));
1170 subMutatorBuffer->injectNew (TYPE_X);
1171 subMutatorBuffer->injectNew (CHILD_A);
1172 subMutatorBuffer->injectNew (CHILD_A);
1173 subMutatorBuffer->injectNew (CHILD_A);
1174 subMutatorBuffer->assignElm (TYPE_Z);
1175 CHECK (subMutatorBuffer->completeScope());
1176 CHECK (mutator3.completeScope());
1179 Rec const& attrRec = root.get(
"δ").data.get<
Rec>();
1180 cout <<
"Att-" << renderNode(attrRec) <<endl;
1183 CHECK (not isnil (attrRec));
1184 CHECK (
"ζ" == attrRec.getType());
1185 CHECK (isnil (attrRec.attribs()));
1186 scope = attrRec.scope();
1187 CHECK (not isnil (scope));
1188 CHECK ( *scope == CHILD_A);
1189 CHECK (*++scope == CHILD_A);
1190 CHECK (*++scope == CHILD_A);
1191 CHECK (isnil (++scope));
1196 CHECK (contains (renderRecord(target), renderRecord(attrRec)));
1197 CHECK (contains (renderRecord(target), renderRecord(nestedRec)));
1199 cout <<
"Content after sub mutation.." 1200 << 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
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.
_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