LocationSolver: test coverage for existentially quantified elements (#1128)
...and again spotted some really insidious bugs
This commit is contained in:
parent
0b21e816e3
commit
983c490644
4 changed files with 52 additions and 26 deletions
|
|
@ -122,9 +122,9 @@ namespace interact {
|
|||
};
|
||||
|
||||
|
||||
extern Symbol UIC_CURRENT_WINDOW; ///< window spec to refer to the _current window_ @see view-locator.cpp
|
||||
extern Symbol UIC_FIRST_WINDOW; ///< window spec to refer to the _first window_ of the application
|
||||
extern Symbol UIC_ELIDED; ///< indicate that a component is elided or irrelevant here
|
||||
extern const Symbol UIC_CURRENT_WINDOW; ///< window spec to refer to the _current window_ @see view-locator.cpp
|
||||
extern const Symbol UIC_FIRST_WINDOW; ///< window spec to refer to the _first window_ of the application
|
||||
extern const Symbol UIC_ELIDED; ///< indicate that a component is elided or irrelevant here
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -63,9 +63,9 @@ namespace interact {
|
|||
|
||||
/* ==== definitions and concrete bindings for the View-Spec-DSL ==== */
|
||||
|
||||
Symbol UIC_CURRENT_WINDOW{"currentWindow"};
|
||||
Symbol UIC_FIRST_WINDOW {"firstWindow"};
|
||||
Symbol UIC_ELIDED {"."};
|
||||
const Symbol UIC_CURRENT_WINDOW{"currentWindow"};
|
||||
const Symbol UIC_FIRST_WINDOW {"firstWindow"};
|
||||
const Symbol UIC_ELIDED {"."};
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -429,6 +429,14 @@ namespace test {
|
|||
CHECK ("UI:currentWindow[*]-panelZ.*.tab" == string(r34));
|
||||
CHECK ("UI:window-3[persp-C]-panelZ.thirdView.tab" == string(r34.cover())); // Note: rest of the path would also match on window-1, but currentWindow == window-3
|
||||
|
||||
UICoordResolver r35 {UICoord::currentWindow().persp(UIC_ELIDED).panel("panelZ").tab("tab"), tree};
|
||||
CHECK ("UI:currentWindow[.]-panelZ.*.tab" == string(r35));
|
||||
CHECK ("UI:window-3[persp-C]-panelZ.thirdView.tab" == string(r35.cover())); // elided (existentially quantified) element interpolated similar to a wildcard
|
||||
|
||||
UICoordResolver r36 {UICoord::currentWindow().panel(UIC_ELIDED).view("nonexisting"), tree};
|
||||
CHECK ("UI:currentWindow[*]-..nonexisting" == string(r36));
|
||||
CHECK ("UI:window-3[persp-C]-panelZ" == string(r36.cover())); // ...but elided counts as existing element and matches arbitrarily (-> contrast this to r44)
|
||||
|
||||
|
||||
/* === trailing wildcards stripped automatically === */
|
||||
UICoordResolver r41 {UICoord::window("window-2").append("*/*"), tree};
|
||||
|
|
@ -543,6 +551,19 @@ namespace test {
|
|||
UICoordResolver r4 {UICoord::currentWindow().tab(3).path("sub"), tree};
|
||||
r4.coverPartially();
|
||||
CHECK (isnil (r4));
|
||||
|
||||
/* === existentially quantified (elided) element constitutes partial coverage === */
|
||||
UICoordResolver r5 {UICoord::currentWindow().persp(UIC_ELIDED).panel("fantasy").view("fantomas"), tree};
|
||||
CHECK ("UI:currentWindow[.]-fantasy.fantomas" == string(r5));
|
||||
CHECK (1 == r5.coverDepth());
|
||||
r5.coverPartially();
|
||||
CHECK (not r5.isCovered());
|
||||
CHECK (2 == r5.coverDepth()); // Note side-effect of computing the coverage...
|
||||
CHECK (r5.isCoveredPartially()); // it is known to be covered including "the" perspective
|
||||
CHECK ("UI:window-2[persp-B]-fantasy.fantomas" == string(r5));
|
||||
r5.cover();
|
||||
CHECK ("UI:window-2[persp-B]" == string(r5));
|
||||
CHECK (2 == r5.coverDepth());
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -8538,7 +8538,7 @@
|
|||
</html></richcontent>
|
||||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1517508915741" ID="ID_974516393" MODIFIED="1517509657311">
|
||||
<node COLOR="#338800" CREATED="1517508915741" ID="ID_974516393" MODIFIED="1518750409200">
|
||||
<richcontent TYPE="NODE"><html>
|
||||
<head>
|
||||
|
||||
|
|
@ -8550,8 +8550,9 @@
|
|||
</body>
|
||||
</html>
|
||||
</richcontent>
|
||||
<arrowlink COLOR="#7e9da8" DESTINATION="ID_796216711" ENDARROW="Default" ENDINCLINATION="989;-91;" ID="Arrow_ID_925245331" STARTARROW="None" STARTINCLINATION="199;-5;"/>
|
||||
<linktarget COLOR="#91a7b5" DESTINATION="ID_974516393" ENDARROW="Default" ENDINCLINATION="-759;53;" ID="Arrow_ID_862004765" SOURCE="ID_140988955" STARTARROW="None" STARTINCLINATION="1590;41;"/>
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1514897795054" ID="ID_1126804251" MODIFIED="1514897809479" TEXT="Erweiterung: verschiedne Filter">
|
||||
|
|
@ -8870,12 +8871,30 @@
|
|||
<node COLOR="#338800" CREATED="1514329555505" ID="ID_1508437078" MODIFIED="1518487921065" TEXT="fehlender Anker plus zweite Lücke">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1517509311733" ID="ID_796216711" MODIFIED="1518487921065" TEXT="Anker+elided plus Lücke schließen">
|
||||
<node COLOR="#338800" CREATED="1517509311733" ID="ID_796216711" MODIFIED="1518750402160" TEXT="Anker+elided plus Lücke schließen">
|
||||
<linktarget COLOR="#4b5cab" DESTINATION="ID_796216711" ENDARROW="Default" ENDINCLINATION="-145;942;" ID="Arrow_ID_570641462" SOURCE="ID_1542036736" STARTARROW="None" STARTINCLINATION="383;78;"/>
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<linktarget COLOR="#7e9da8" DESTINATION="ID_796216711" ENDARROW="Default" ENDINCLINATION="989;-91;" ID="Arrow_ID_925245331" SOURCE="ID_974516393" STARTARROW="None" STARTINCLINATION="199;-5;"/>
|
||||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1517509325755" ID="ID_208496330" MODIFIED="1518487921065" TEXT="Anker+elided gilt als partial coverage">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<node COLOR="#338800" CREATED="1517509541382" FOLDED="true" ID="ID_1722401650" MODIFIED="1518752274910">
|
||||
<richcontent TYPE="NODE"><html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<p>
|
||||
realer Pfad endet mit elided <i>nach</i> Wildcard
|
||||
</p>
|
||||
</body>
|
||||
</html></richcontent>
|
||||
<icon BUILTIN="button_ok"/>
|
||||
<node CREATED="1518752249648" ID="ID_221401224" MODIFIED="1518752257211" TEXT="erst wollte ich das ausschließen"/>
|
||||
<node CREATED="1518752257871" ID="ID_1394674174" MODIFIED="1518752269436" TEXT="denke jetzt aber, das soll so sein">
|
||||
<icon BUILTIN="yes"/>
|
||||
</node>
|
||||
</node>
|
||||
<node COLOR="#338800" CREATED="1517509325755" ID="ID_208496330" MODIFIED="1518758436086" TEXT="Anker+elided gilt als partial coverage">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
</node>
|
||||
<node COLOR="#338800" CREATED="1514329861519" ID="ID_946875811" MODIFIED="1518487921065" TEXT="Scheitern">
|
||||
|
|
@ -8907,20 +8926,6 @@
|
|||
<node COLOR="#338800" CREATED="1514329901562" ID="ID_1644217459" MODIFIED="1518487921065" TEXT="realer Pfad endet bündig mit Wildcards">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1517509541382" ID="ID_1722401650" MODIFIED="1518487921066">
|
||||
<richcontent TYPE="NODE"><html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<p>
|
||||
realer Pfad endet mit elided <i>nach</i> Wildcard
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
</richcontent>
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
</node>
|
||||
<node COLOR="#338800" CREATED="1514329925895" ID="ID_257945525" MODIFIED="1518487921066" TEXT="mismatch auf erstem festen element">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
|
|
|
|||
Loading…
Reference in a new issue