UI-Coordinates: define next steps to cover
This commit is contained in:
parent
8c694b6ec0
commit
6322f1bc3c
5 changed files with 198 additions and 7 deletions
|
|
@ -137,6 +137,17 @@ namespace interact {
|
|||
UNIMPLEMENTED ("augment UI coordinates to indicate a tab specified by index number");
|
||||
}
|
||||
|
||||
/**
|
||||
* convenience builder function so set a full path definition
|
||||
* @note the given path string will be split at `'/'` and the
|
||||
* resulting components will be stored/retrieved as Symbol
|
||||
*/
|
||||
UICoord
|
||||
path (string pathDefinition) const
|
||||
{
|
||||
UNIMPLEMENTED ("augment UI coordinates to append a full local path");
|
||||
}
|
||||
|
||||
UICoord
|
||||
append (Literal elmID) const
|
||||
{
|
||||
|
|
|
|||
|
|
@ -318,6 +318,17 @@ namespace lib {
|
|||
return *elm;
|
||||
}
|
||||
|
||||
/** reverse lookup of actual path content
|
||||
* @param content reference to actual content _residing within the path_
|
||||
* @return index position of the content within the path
|
||||
* @throws error::Invalid when the given storage location
|
||||
* is outside the data content storage of this path
|
||||
*/
|
||||
size_t
|
||||
indexOf (Literal const& content) const
|
||||
{
|
||||
UNIMPLEMENTED ("reverse lookup");
|
||||
}
|
||||
|
||||
|
||||
protected: /* ==== Iteration control API for IterAdapter ==== */
|
||||
|
|
|
|||
|
|
@ -76,6 +76,7 @@ namespace test {
|
|||
{
|
||||
verify_basics();
|
||||
verify_builder();
|
||||
verify_stringRepr();
|
||||
verify_comparisons();
|
||||
verify_queryAnchor();
|
||||
verify_queryCoverage();
|
||||
|
|
@ -126,7 +127,7 @@ namespace test {
|
|||
CHECK (7 == uic.size());
|
||||
|
||||
// representation is trimmed and filled
|
||||
CHECK ("UI:Θ.*.*/*/Φ" == string(uic));
|
||||
CHECK ("UI:Θ.*.Σ/*/Φ" == string(uic));
|
||||
CHECK (Symbol::EMPTY == uic[UIC_WINDOW]);
|
||||
CHECK (Symbol::EMPTY == uic[UIC_PERSP]);
|
||||
CHECK ("Θ" == uic[UIC_PANEL]);
|
||||
|
|
@ -191,6 +192,151 @@ namespace test {
|
|||
}
|
||||
|
||||
|
||||
void
|
||||
verify_stringRepr()
|
||||
{
|
||||
UICoord uic;
|
||||
CHECK ("UI:?" == string(uic));
|
||||
CHECK ("" == uic.getComp());
|
||||
CHECK ("" == uic.getPath());
|
||||
|
||||
uic = uic.path("ἁρχή");
|
||||
CHECK ("UI:?/ἁρχή" == string(uic));
|
||||
CHECK ("" == uic.getComp());
|
||||
CHECK ("ἁρχή" == uic.getPath());
|
||||
|
||||
uic = uic.path("α/β/γ");
|
||||
CHECK ("UI:?/α/β/γ" == string(uic));
|
||||
CHECK ("" == uic.getComp());
|
||||
CHECK ("α/β/γ" == uic.getPath());
|
||||
|
||||
uic = uic.append("δ");
|
||||
CHECK ("UI:?/α/β/γ/δ" == string(uic));
|
||||
CHECK ("" == uic.getComp());
|
||||
CHECK ("α/β/γ/δ" == uic.getPath());
|
||||
|
||||
uic = uic.append("");
|
||||
CHECK ("UI:?/α/β/γ/δ" == string(uic));
|
||||
CHECK ("" == uic.getComp());
|
||||
CHECK ("α/β/γ/δ" == uic.getPath());
|
||||
|
||||
uic = uic.append("ε/λ/ον");
|
||||
CHECK ("UI:?/α/β/γ/δ/ε/λ/ον" == string(uic));
|
||||
CHECK ("" == uic.getComp());
|
||||
CHECK ("α/β/γ/δ/ε/λ/ον" == uic.getPath());
|
||||
|
||||
// note: we built a partially empty path array...
|
||||
CHECK (12 == uic.size());
|
||||
CHECK (Symbol::EMPTY == uic.getView());
|
||||
CHECK (Symbol::EMPTY == uic.getTab());
|
||||
CHECK (Symbol::EMPTY == uic[UIC_WINDOW]);
|
||||
CHECK (Symbol::EMPTY == uic[UIC_PERSP]);
|
||||
CHECK (Symbol::EMPTY == uic[UIC_PANEL]);
|
||||
CHECK (Symbol::EMPTY == uic[UIC_VIEW]);
|
||||
CHECK (Symbol::EMPTY == uic[UIC_TAB]);
|
||||
CHECK ("α" == uic[UIC_PART]);
|
||||
CHECK ("β" == uic[UIC_PART+1]);
|
||||
CHECK ("γ" == uic[UIC_PART+2]);
|
||||
CHECK ("δ" == uic[UIC_PART+3]);
|
||||
CHECK ("ε" == uic[UIC_PART+4]);
|
||||
CHECK ("λ" == uic[UIC_PART+5]);
|
||||
CHECK ("ον" == uic[UIC_PART+6]);
|
||||
|
||||
uic = uic.prepend("ειδος");
|
||||
CHECK ("UI:?.ειδος/α/β/γ/δ/ε/λ/ον" == string(uic));
|
||||
CHECK ("?.ειδος" == uic.getComp());
|
||||
CHECK ("α/β/γ/δ/ε/λ/ον" == uic.getPath());
|
||||
CHECK (12 == uic.size());
|
||||
|
||||
uic = uic.tab("");
|
||||
CHECK ("UI:?/α/β/γ/δ/ε/λ/ον" == string(uic));
|
||||
CHECK ("" == uic.getComp());
|
||||
CHECK ("α/β/γ/δ/ε/λ/ον" == uic.getPath());
|
||||
|
||||
uic = uic.view("ειδος");
|
||||
CHECK ("UI:?.ειδος.*/α/β/γ/δ/ε/λ/ον" == string(uic));
|
||||
CHECK ("?.ειδος.*" == uic.getComp());
|
||||
CHECK ("α/β/γ/δ/ε/λ/ον" == uic.getPath());
|
||||
|
||||
uic = uic.prepend("panel");
|
||||
CHECK ("UI:?-panel.ειδος.*/α/β/γ/δ/ε/λ/ον" == string(uic));
|
||||
CHECK ("?-panel.ειδος.*" == uic.getComp());
|
||||
CHECK ("α/β/γ/δ/ε/λ/ον" == uic.getPath());
|
||||
|
||||
uic = uic.view(nullptr);
|
||||
CHECK ("UI:?-panel.*.*/α/β/γ/δ/ε/λ/ον" == string(uic));
|
||||
CHECK ("?-panel.*.*" == uic.getComp());
|
||||
CHECK ("α/β/γ/δ/ε/λ/ον" == uic.getPath());
|
||||
|
||||
uic = uic.tab(" ");
|
||||
CHECK ("UI:?-panel.*. /α/β/γ/δ/ε/λ/ον" == string(uic));
|
||||
CHECK ("?-panel.*. " == uic.getComp());
|
||||
CHECK ("α/β/γ/δ/ε/λ/ον" == uic.getPath());
|
||||
|
||||
uic = uic.prepend("perspective");
|
||||
CHECK ("UI:UI:?[perspective]-panel.*. /α/β/γ/δ/ε/λ/ον" == string(uic));
|
||||
CHECK ("?[perspective]-panel.*. " == uic.getComp());
|
||||
CHECK ("α/β/γ/δ/ε/λ/ον" == uic.getPath());
|
||||
|
||||
uic = uic.prepend("win");
|
||||
CHECK ("UI:UI:win[perspective]-panel.*. /α/β/γ/δ/ε/λ/ον" == string(uic));
|
||||
CHECK ("win[perspective]-panel.*. " == uic.getComp());
|
||||
CHECK ("α/β/γ/δ/ε/λ/ον" == uic.getPath());
|
||||
|
||||
uic = uic.persp("");
|
||||
CHECK ("UI:UI:win[*]-panel.*. /α/β/γ/δ/ε/λ/ον" == string(uic));
|
||||
CHECK ("win[*]-panel.*. " == uic.getComp());
|
||||
CHECK ("α/β/γ/δ/ε/λ/ον" == uic.getPath());
|
||||
CHECK (12 == uic.size());
|
||||
|
||||
uic = uic.path(" ");
|
||||
CHECK ("UI:UI:win[*]-panel.*. / " == string(uic));
|
||||
CHECK ("win[*]-panel.*. " == uic.getComp());
|
||||
CHECK (" " == uic.getPath());
|
||||
CHECK (6 == uic.size());
|
||||
CHECK (" " == uic[UIC_PART]);
|
||||
VERIFY_ERROR (INDEX_BOUNDS, uic[UIC_PART+1]);
|
||||
|
||||
uic = uic.path(nullptr);
|
||||
CHECK ("UI:UI:win[*]-panel.*. " == string(uic));
|
||||
CHECK ("win[*]-panel.*. " == uic.getComp());
|
||||
CHECK ("" == uic.getPath());
|
||||
CHECK (5 == uic.size());
|
||||
VERIFY_ERROR (INDEX_BOUNDS, uic[UIC_PART]);
|
||||
|
||||
uic = uic.append(nullptr);
|
||||
CHECK ("UI:UI:win[*]-panel.*. " == string(uic));
|
||||
CHECK ("win[*]-panel.*. " == uic.getComp());
|
||||
CHECK ("" == uic.getPath());
|
||||
CHECK (5 == uic.size());
|
||||
|
||||
uic = uic.append("*");
|
||||
CHECK ("UI:UI:win[*]-panel.*. " == string(uic));
|
||||
CHECK ("win[*]-panel.*. " == uic.getComp());
|
||||
CHECK ("" == uic.getPath());
|
||||
CHECK (5 == uic.size());
|
||||
|
||||
uic = uic.append("**");
|
||||
CHECK ("UI:UI:win[*]-panel.*. /**" == string(uic));
|
||||
CHECK ("win[*]-panel.*. " == uic.getComp());
|
||||
CHECK ("**" == uic.getPath());
|
||||
CHECK ("**" == uic[UIC_PART]);
|
||||
CHECK (6 == uic.size());
|
||||
|
||||
uic = uic.tab("");
|
||||
CHECK ("UI:UI:win[*]-panel.*.*/**" == string(uic));
|
||||
CHECK ("win[*]-panel.*.*" == uic.getComp());
|
||||
CHECK ("**" == uic.getPath());
|
||||
CHECK (6 == uic.size());
|
||||
|
||||
uic = uic.path("");
|
||||
CHECK ("UI:UI:win[*]-panel" == string(uic));
|
||||
CHECK ("win[*]-panel" == uic.getComp());
|
||||
CHECK ("" == uic.getPath());
|
||||
CHECK (3 == uic.size());
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
verify_comparisons()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ namespace lib {
|
|||
namespace test {
|
||||
|
||||
using lumiera::error::LUMIERA_ERROR_INDEX_BOUNDS;
|
||||
using lumiera::error::LUMIERA_ERROR_LOGIC;
|
||||
using lumiera::error::LUMIERA_ERROR_INVALID;
|
||||
|
||||
using ParrT = lib::PathArray<5>;
|
||||
|
||||
|
|
@ -158,6 +158,21 @@ namespace test {
|
|||
CHECK (Symbol::EMPTY == parr[2]);
|
||||
CHECK ("Ω" == parr[15]);
|
||||
VERIFY_ERROR (INDEX_BOUNDS, parr[16]);
|
||||
|
||||
// but iteration starts with actual content
|
||||
parr = ParrT{nullptr,nullptr,"Θ","Ξ","Σ","Ψ","Φ","Ω"};
|
||||
CHECK ("Θ" == *parr.begin());
|
||||
CHECK ( 2 == parr.indexOf (*parr.begin()));
|
||||
CHECK ("Θ" == parr[2]);
|
||||
|
||||
parr = ParrT{nullptr,nullptr,nullptr,nullptr,"Σ","Ψ","Φ","Ω"};
|
||||
CHECK ("Σ" == *parr.begin());
|
||||
CHECK ( 5 == parr.indexOf (*parr.begin()));
|
||||
CHECK ( 6 == parr.indexOf (*++parr.begin()));
|
||||
CHECK ( 7 == parr.indexOf (*++++parr.begin()));
|
||||
|
||||
Literal some{"muck"};
|
||||
VERIFY_ERROR (INVALID, parr.indexOf (some));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -3826,11 +3826,13 @@
|
|||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1506181068556" ID="ID_749871444" MODIFIED="1506181084051" TEXT="UICoord">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1506181721910" ID="ID_1680105436" MODIFIED="1506181735861" TEXT="Symbol-Tupel">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<node CREATED="1506263953722" ID="ID_1293486815" MODIFIED="1506263959604" TEXT="Basis-Abstraktion"/>
|
||||
<node CREATED="1506263960121" ID="ID_381874562" MODIFIED="1506263965699" TEXT="PathArray">
|
||||
<icon BUILTIN="pencil"/>
|
||||
<node COLOR="#338800" CREATED="1506181721910" FOLDED="true" ID="ID_1680105436" MODIFIED="1506831506238" TEXT="Folge von Symbolen">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
<node CREATED="1506263953722" ID="ID_1293486815" MODIFIED="1506831482410" TEXT="Basis-Abstraktion">
|
||||
<icon BUILTIN="info"/>
|
||||
</node>
|
||||
<node COLOR="#338800" CREATED="1506263960121" ID="ID_381874562" MODIFIED="1506831498373" TEXT="PathArray">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
<node CREATED="1506301404246" ID="ID_458341734" MODIFIED="1506301409177" TEXT="Impl-Layout">
|
||||
<node CREATED="1506301410525" ID="ID_176098837" MODIFIED="1506301414840" TEXT="Rekursiv"/>
|
||||
<node CREATED="1506301415548" ID="ID_212757263" MODIFIED="1506301419912" TEXT="chunk-wise"/>
|
||||
|
|
@ -3901,6 +3903,12 @@
|
|||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node COLOR="#338800" CREATED="1506831455771" ID="ID_1302634711" MODIFIED="1506831476337" TEXT="Normalisierung">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
<node COLOR="#338800" CREATED="1506831461738" ID="ID_1629539998" MODIFIED="1506831477640" TEXT="Unit-Test der Grenzfälle">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1506181727069" ID="ID_467120404" MODIFIED="1506181737140" TEXT="lokale Prädikate">
|
||||
|
|
|
|||
Loading…
Reference in a new issue