reshape test diff to be more in line with the newly written implementation

...during implementation of the binding, I decided to be more strict
with the interpretation of "reshaping" of attributes: since my onion-layer
for attribute binding works without the notion of any 'position' or 'ordering',
I made up my mind that it's best outright to reject any diff verbs attempting
to re-order or delete attributes. The rationale is that otherwise the same diff
might lead to substantially different results when applied to a Rec<GenNode>
as when applied to a target data structure bound via TreeMutator.

Consequently, the previously established test diff sequence would raise an error::Logic
in the second segment, since it attempts to re-order attributes. Instead of this,
I've now introduced a after(Ref::ATTRIBS) verb and I'm re-ordering children
rather than attributes.

Unfortunately this also prompts me to re-adjust all of the TreeMutatorBinding_tests,
since these detail tests are intended to play the same sequence on low level.
This is not a fundamental problem, though, just laborious.          CHECK (target.showContent() == "α = 1, γ = 3.45, γ = 3.45, β = 2, Rec(), 78:56:34.012, b");
This commit is contained in:
Fischlurch 2016-08-13 17:50:40 +02:00
parent e1687c1c18
commit 33534065a6

View file

@ -277,22 +277,20 @@ namespace test{
, ins(CHILD_B)
, ins(CHILD_T)
});
} // ==> ATTRIB1, ATTRIB3, ATTRIB3, CHILD_B, CHILD_B, CHILD_T
} // ==> ATTRIB1, ATTRIB3, (ATTRIB3), CHILD_B, CHILD_B, CHILD_T
DiffSeq
reorderingDiff()
{
return snapshot({find(ATTRIB3)
, pick(ATTRIB1)
, skip(ATTRIB3)
return snapshot({after(Ref::ATTRIBS)
, ins(ATTRIB2)
, pick(ATTRIB3)
, del(CHILD_B)
, ins(SUB_NODE)
, find(CHILD_T)
, pick(CHILD_B)
, pick(CHILD_T)
, skip(CHILD_T)
});
} // ==> ATTRIB3, ATTRIB1, ATTRIB2, ATTRIB3, SUB_NODE, CHILD_B, CHILD_T
} // ==> ATTRIB1, ATTRIB3, (ATTRIB3), ATTRIB2, SUB_NODE, CHILD_T, CHILD_B
DiffSeq
mutationDiff()
@ -314,10 +312,10 @@ namespace test{
, ins(CHILD_A)
, emu(ATTRIB_NODE)
});
} // ==> ATTRIB3 := π, ATTRIB1, ATTRIB2, ATTRIB3,
} // ==> ATTRIB1, ATTRIB3 := π, (ATTRIB3), ATTRIB2,
// ATTRIB_NODE{ type ζ, CHILD_A, CHILD_A, CHILD_A }
// SUB_NODE{ type ξ, ATTRIB2, CHILD_B, CHILD_A },
// CHILD_B, CHILD_T,
// CHILD_T, CHILD_B