Navigator: test for path extension now basically working as intended
This commit is contained in:
parent
f10263c469
commit
2d66293c32
4 changed files with 43 additions and 21 deletions
|
|
@ -322,7 +322,6 @@ namespace interact {
|
|||
res_.depth = res_.covfefe->size();
|
||||
this->uic_ = std::move (*res_.covfefe);
|
||||
res_.covfefe.reset();
|
||||
ENSURE (isCovered());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -331,6 +330,7 @@ namespace interact {
|
|||
REQUIRE (not res_.covfefe);
|
||||
truncateTo (0);
|
||||
}
|
||||
ENSURE (isCovered());
|
||||
return std::move (*this);
|
||||
}
|
||||
|
||||
|
|
@ -366,7 +366,6 @@ namespace interact {
|
|||
ENSURE (isCovered());
|
||||
append (pathExtension);
|
||||
res_.depth = query_.determineCoverage (this->uic_); // coverage may grow
|
||||
ENSURE (isCoveredPartially());
|
||||
return std::move (*this);
|
||||
}
|
||||
|
||||
|
|
@ -374,27 +373,28 @@ namespace interact {
|
|||
extend (UICoord const& partialExtensionSpec)
|
||||
{
|
||||
if (not canCover())
|
||||
{
|
||||
uic_ = partialExtensionSpec;
|
||||
}
|
||||
uic_ = partialExtensionSpec;
|
||||
else
|
||||
{
|
||||
ENSURE (res_.isResolved and res_.covfefe);
|
||||
size_t coverable = res_.covfefe->size();
|
||||
REQUIRE (res_.isResolved);
|
||||
size_t coverable = res_.covfefe? res_.covfefe->size() : res_.depth;
|
||||
auto newContent = partialExtensionSpec.begin();
|
||||
size_t extensionPos = newContent? partialExtensionSpec.indexOf(*newContent) : 0;
|
||||
if (coverable >= extensionPos)
|
||||
throw error::Invalid (util::_Fmt{"Attempt to extend covered path %s with %s "
|
||||
"would overwrite positions %d to %d (incl)"}
|
||||
% *res_.covfefe
|
||||
% (res_.covfefe? *res_.covfefe : UICoord{uic_.rebuild().truncateTo(res_.depth)})
|
||||
% partialExtensionSpec
|
||||
% extensionPos
|
||||
% coverable);
|
||||
cover();
|
||||
for ( ; newContent; ++newContent, ++extensionPos )
|
||||
overwrite (extensionPos, *newContent);
|
||||
normalise();
|
||||
}
|
||||
res_.depth = query_.determineCoverage (this->uic_); // coverage may grow
|
||||
res_ = Resolution{}; // start over with pristine resolution state
|
||||
attempt_trivialResolution();
|
||||
canCover();
|
||||
return std::move (*this);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -158,6 +158,7 @@ namespace interact {
|
|||
Builder path (Literal pathDefinition) const;
|
||||
Builder append (Literal elmID) const;
|
||||
Builder prepend (Literal elmID) const;
|
||||
Builder rebuild() const;
|
||||
|
||||
|
||||
|
||||
|
|
@ -711,6 +712,12 @@ namespace interact {
|
|||
return Builder(*this).prepend (elmID);
|
||||
}
|
||||
|
||||
inline UICoord::Builder
|
||||
UICoord::rebuild () const
|
||||
{
|
||||
return Builder(*this);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}}// namespace gui::interact
|
||||
|
|
|
|||
|
|
@ -634,18 +634,24 @@ namespace test {
|
|||
|
||||
/* === extend fully covered explicit path === */
|
||||
UICoordResolver r1 {UICoord{"window-2","persp-B","panelY"}, tree};
|
||||
r1.extend (UICoord().path("engulfed"));
|
||||
r1.extend (UICoord().path("gappy").tab(2));
|
||||
cout << string(r1)<<endl;
|
||||
r1.extend ("seamless");
|
||||
cout << string(r1)<<endl;
|
||||
|
||||
/* === extend partially covered path === */
|
||||
UICoordResolver r2 {UICoord().view("thirdView").append("some/where"), tree};
|
||||
r2.extend ("no/where");
|
||||
cout << string(r2)<<endl;
|
||||
VERIFY_ERROR (INVALID, r2.extend(UICoord().persp("fisheye")));
|
||||
cout << string(r2)<<endl;
|
||||
|
||||
/* === unsolvable: truncate, extend, recalculate coverage === */
|
||||
UICoordResolver r3 {UICoord().persp("awesome"), tree};
|
||||
r3.extend (UICoord::currentWindow().view("outlandish"));
|
||||
CHECK (not r3.canCover());
|
||||
CHECK (0 == r3.coverDepth());
|
||||
r3.extend (UICoord::currentWindow().tab(1));
|
||||
CHECK (1 == r3.coverDepth());
|
||||
cout << string(r3)<<endl;
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -8936,21 +8936,24 @@
|
|||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1515451105808" ID="ID_1323377531" MODIFIED="1515451115328" TEXT="extend">
|
||||
<icon BUILTIN="pencil"/>
|
||||
<node COLOR="#338800" CREATED="1515451105808" ID="ID_1323377531" MODIFIED="1515460214743" TEXT="extend">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
<node COLOR="#338800" CREATED="1515451117055" ID="ID_602743049" MODIFIED="1515451126326" TEXT="durch explizit gegebenes Suffix">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1515451127221" ID="ID_130067342" MODIFIED="1515451168209" TEXT="durch (partielle) UI-Coord spec">
|
||||
<node COLOR="#338800" CREATED="1515451127221" ID="ID_130067342" MODIFIED="1515460212289" TEXT="durch (partielle) UI-Coord spec">
|
||||
<linktarget COLOR="#4f6f95" DESTINATION="ID_130067342" ENDARROW="Default" ENDINCLINATION="544;89;" ID="Arrow_ID_992203487" SOURCE="ID_1736775031" STARTARROW="None" STARTINCLINATION="704;0;"/>
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<node CREATED="1515455194222" ID="ID_1550640486" MODIFIED="1515455202609" TEXT="brauche (nun doch) overwrite">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
<node CREATED="1515455194222" ID="ID_1550640486" MODIFIED="1515460223240" TEXT="brauche (nun doch) overwrite">
|
||||
<icon BUILTIN="yes"/>
|
||||
<node CREATED="1515455204572" ID="ID_538708318" MODIFIED="1515455215023" TEXT="im UI-Coord-Builder ansiedeln"/>
|
||||
<node CREATED="1515455215779" ID="ID_1744879837" MODIFIED="1515455225131" TEXT="protected....">
|
||||
<icon BUILTIN="smiley-neutral"/>
|
||||
</node>
|
||||
</node>
|
||||
<node CREATED="1515455238808" ID="ID_1864948105" MODIFIED="1515455247459" TEXT="Fehlerbehandlung: Überlapp finden"/>
|
||||
<node CREATED="1515455238808" ID="ID_1864948105" MODIFIED="1515460226143" TEXT="Fehlerbehandlung: Überlapp finden">
|
||||
<icon BUILTIN="yes"/>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
|
|
@ -9368,10 +9371,10 @@
|
|||
<icon BUILTIN="flag-yellow"/>
|
||||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1506984645748" ID="ID_768385613" MODIFIED="1506984662154" TEXT="verify_mutateExtend">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1515449655380" ID="ID_1282321814" MODIFIED="1515449740717" TEXT="expliziten Pfad erweitern">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1506984645748" ID="ID_768385613" MODIFIED="1515460236134" TEXT="verify_mutateExtend">
|
||||
<icon BUILTIN="pencil"/>
|
||||
<node COLOR="#338800" CREATED="1515449655380" ID="ID_1282321814" MODIFIED="1515460194102" TEXT="expliziten Pfad erweitern">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1515450991631" ID="ID_1736775031" MODIFIED="1515451168209" TEXT="Pfad durch partielle UI-Coord erweitern">
|
||||
<arrowlink COLOR="#4f6f95" DESTINATION="ID_130067342" ENDARROW="Default" ENDINCLINATION="544;89;" ID="Arrow_ID_992203487" STARTARROW="None" STARTINCLINATION="704;0;"/>
|
||||
|
|
@ -9387,6 +9390,12 @@
|
|||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1515455296784" ID="ID_957569216" MODIFIED="1515455313258" TEXT="sinnvolle Fehlermeldung">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1515456807297" ID="ID_940232878" MODIFIED="1515456829799" TEXT="ausgehend von expliziter Spec">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1515456817248" ID="ID_631326169" MODIFIED="1515456828903" TEXT="ausgehend von berechneter Coverage-Lösung">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1515449669446" ID="ID_1747646759" MODIFIED="1515449741572" TEXT="partially covered erweitern">
|
||||
|
|
|
|||
Loading…
Reference in a new issue