EventLog: verify and complete the TestEventLog_test
can now cover all the cases as initially intended, including backtracking
This commit is contained in:
parent
3994f805b0
commit
03a1d58198
4 changed files with 55 additions and 16 deletions
|
|
@ -32,6 +32,12 @@
|
||||||
**
|
**
|
||||||
** Failure of match prints a detailed trace message to `STDERR`, in order
|
** Failure of match prints a detailed trace message to `STDERR`, in order
|
||||||
** to deliver a precise indication what part of the condition failed.
|
** to deliver a precise indication what part of the condition failed.
|
||||||
|
** @note this sequence prints the matches succeeding _at the point_ where each
|
||||||
|
** condition is added to the chain. Adding more conditions, especially when
|
||||||
|
** combined with changed search direction, might lead to backtracking, which
|
||||||
|
** happens silently within the search engine, without printing any further
|
||||||
|
** diagnostics. This means: the sequence of matches you see in this diagnostic
|
||||||
|
** output is not necessarily the last match patch, which lead to the final failure
|
||||||
**
|
**
|
||||||
** @see TestEventLog_test
|
** @see TestEventLog_test
|
||||||
** @see [usage example](\ref AbstractTangible_test)
|
** @see [usage example](\ref AbstractTangible_test)
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,12 @@ err-lit: ..before match("beans") @ Rec(EventLogHeader| this = baked beans )
|
||||||
err-lit: ..before match("spam") @ Rec(event|{spam})
|
err-lit: ..before match("spam") @ Rec(event|{spam})
|
||||||
err-lit: ..after HEAD baked beans
|
err-lit: ..after HEAD baked beans
|
||||||
err-lit: __Log_condition_violated__
|
err-lit: __Log_condition_violated__
|
||||||
|
err-lit: FAILED to match("spam")
|
||||||
|
err-lit: ..before match("spam") @ Rec(event|{spam})
|
||||||
|
err-lit: ..before match("ham") @ Rec(event|{ham})
|
||||||
|
err-lit: ..before match("beans") @ Rec(EventLogHeader| this = baked beans )
|
||||||
|
err-lit: ..after HEAD baked beans
|
||||||
|
err-lit: __Log_condition_violated__
|
||||||
err-lit: FOUND at least match("ham") @ Rec(event|{ham})
|
err-lit: FOUND at least match("ham") @ Rec(event|{ham})
|
||||||
err-lit: ..after match("eggs") @ Rec(EventLogHeader| this = eggs )
|
err-lit: ..after match("eggs") @ Rec(EventLogHeader| this = eggs )
|
||||||
err-lit: ..before match("spam") @ Rec(event|{spam})
|
err-lit: ..before match("spam") @ Rec(event|{spam})
|
||||||
|
|
|
||||||
|
|
@ -110,8 +110,14 @@ namespace test{
|
||||||
CHECK (not log.verify("spam").after("beans").after("ham"));
|
CHECK (not log.verify("spam").after("beans").after("ham"));
|
||||||
|
|
||||||
log.event("beans");
|
log.event("beans");
|
||||||
CHECK (log.verify("beans").after("spam"));
|
CHECK (log.verify("beans").after("spam")); // Note: Backtracking! The first match on beans fails,
|
||||||
}
|
// only the match on second beans succeeds.
|
||||||
|
|
||||||
|
// consecutive matches always move by at least one step
|
||||||
|
CHECK ( log.verify("beans").after("ham").after("spam") .after("baked"));
|
||||||
|
CHECK (not log.verify("beans").after("ham").after("spam").after("spam").after("baked"));
|
||||||
|
CHECK ( log.verify("beans").after("ham").after("spam").locate("spam").locate("spam").after("baked"));
|
||||||
|
} // ^^^^^^ locate re-applies at current pos without moving
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -342,14 +348,12 @@ namespace test{
|
||||||
"with shallots and aubergines garnished with truffle pate, brandy and with a fried egg on top and spam");
|
"with shallots and aubergines garnished with truffle pate, brandy and with a fried egg on top and spam");
|
||||||
|
|
||||||
CHECK (log.verify("spam").before("(spam|").before("egg on top and spam"));
|
CHECK (log.verify("spam").before("(spam|").before("egg on top and spam"));
|
||||||
|
CHECK (log.verify("and spam").after("(spam|").after("spam!").before("bacon"));
|
||||||
CHECK (log.ensureNot("and spam").after("(spam|").after("spam!").after("bacon"));
|
CHECK (log.ensureNot("and spam").after("(spam|").after("spam!").after("bacon"));
|
||||||
|
|
||||||
// note: each consecutive match starts with the same element, on which the previous one succeeded
|
|
||||||
CHECK (log.verify("spam").before("spam").before("spam").before("spam").before("spam").before("bacon"));
|
|
||||||
|
|
||||||
// RegExp on full String representation
|
// RegExp on full String representation
|
||||||
CHECK (log.verifyMatch("spam.+spam"));
|
CHECK (log.verifyMatch("spam.+spam"));
|
||||||
CHECK (log.verifyMatch("spam.+spam").beforeMatch("spam(?!spam)"));
|
CHECK (log.verifyMatch("spam.+spam").beforeMatch("spam(?!.+spam)"));
|
||||||
CHECK (log.verifyEvent("fatal","spam").afterMatch("(spam.*){15}"));
|
CHECK (log.verifyEvent("fatal","spam").afterMatch("(spam.*){15}"));
|
||||||
|
|
||||||
// Cover all arguments with sequence of regular expressions
|
// Cover all arguments with sequence of regular expressions
|
||||||
|
|
|
||||||
|
|
@ -31695,6 +31695,23 @@
|
||||||
<icon BUILTIN="button_ok"/>
|
<icon BUILTIN="button_ok"/>
|
||||||
<node CREATED="1537058445064" ID="ID_1377843323" MODIFIED="1537058450843" TEXT="kompletten Filter-Konfigurator"/>
|
<node CREATED="1537058445064" ID="ID_1377843323" MODIFIED="1537058450843" TEXT="kompletten Filter-Konfigurator"/>
|
||||||
<node CREATED="1537058451527" ID="ID_1849109468" MODIFIED="1537058459138" TEXT="stets auch die Richtung setzen"/>
|
<node CREATED="1537058451527" ID="ID_1849109468" MODIFIED="1537058459138" TEXT="stets auch die Richtung setzen"/>
|
||||||
|
<node CREATED="1537316776292" ID="ID_507846374" MODIFIED="1537316870949" TEXT="hier nun stets einen Schritt machen">
|
||||||
|
<richcontent TYPE="NOTE"><html>
|
||||||
|
<head>
|
||||||
|
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<p>
|
||||||
|
...um "Hängenbleiben" auf dem gleichen Element auszuschließen.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Vorsicht: um sauber genau einen Schritt machen zu können, müssen wir explizit vorübergehend den Filter abschalten
|
||||||
|
</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
</richcontent>
|
||||||
|
<arrowlink COLOR="#5174b2" DESTINATION="ID_256131209" ENDARROW="Default" ENDINCLINATION="-241;-10;" ID="Arrow_ID_73536182" STARTARROW="None" STARTINCLINATION="169;19;"/>
|
||||||
|
</node>
|
||||||
</node>
|
</node>
|
||||||
<node COLOR="#338800" CREATED="1537058470628" ID="ID_244817932" MODIFIED="1537059384506" TEXT="refineSerach">
|
<node COLOR="#338800" CREATED="1537058470628" ID="ID_244817932" MODIFIED="1537059384506" TEXT="refineSerach">
|
||||||
<icon BUILTIN="button_ok"/>
|
<icon BUILTIN="button_ok"/>
|
||||||
|
|
@ -31749,7 +31766,7 @@
|
||||||
</node>
|
</node>
|
||||||
<node BACKGROUND_COLOR="#fdfdcf" COLOR="#ff0000" CREATED="1537059388025" ID="ID_1276869558" MODIFIED="1537059394146" TEXT="Tests scheitern...">
|
<node BACKGROUND_COLOR="#fdfdcf" COLOR="#ff0000" CREATED="1537059388025" ID="ID_1276869558" MODIFIED="1537059394146" TEXT="Tests scheitern...">
|
||||||
<icon BUILTIN="flag-pink"/>
|
<icon BUILTIN="flag-pink"/>
|
||||||
<node CREATED="1537059395184" ID="ID_77123611" MODIFIED="1537059453857" TEXT="EventLog_test">
|
<node COLOR="#338800" CREATED="1537059395184" ID="ID_77123611" MODIFIED="1537316730803" TEXT="EventLog_test">
|
||||||
<richcontent TYPE="NOTE"><html>
|
<richcontent TYPE="NOTE"><html>
|
||||||
<head>
|
<head>
|
||||||
|
|
||||||
|
|
@ -31762,6 +31779,7 @@
|
||||||
</html>
|
</html>
|
||||||
</richcontent>
|
</richcontent>
|
||||||
<icon BUILTIN="info"/>
|
<icon BUILTIN="info"/>
|
||||||
|
<icon BUILTIN="button_ok"/>
|
||||||
<node CREATED="1537059455216" ID="ID_318014472" MODIFIED="1537309403475">
|
<node CREATED="1537059455216" ID="ID_318014472" MODIFIED="1537309403475">
|
||||||
<richcontent TYPE="NODE"><html>
|
<richcontent TYPE="NODE"><html>
|
||||||
<head>
|
<head>
|
||||||
|
|
@ -31793,8 +31811,9 @@
|
||||||
</node>
|
</node>
|
||||||
<node CREATED="1537230078498" ID="ID_746060961" MODIFIED="1537230098331" TEXT="wir setzen am vorherigen Match auf"/>
|
<node CREATED="1537230078498" ID="ID_746060961" MODIFIED="1537230098331" TEXT="wir setzen am vorherigen Match auf"/>
|
||||||
<node CREATED="1537230100031" ID="ID_831756745" MODIFIED="1537230107546" TEXT="das ist überraschend"/>
|
<node CREATED="1537230100031" ID="ID_831756745" MODIFIED="1537230107546" TEXT="das ist überraschend"/>
|
||||||
<node COLOR="#435e98" CREATED="1537230108686" ID="ID_256131209" MODIFIED="1537309438059" TEXT="sollten wir das ändern?">
|
<node COLOR="#435e98" CREATED="1537230108686" ID="ID_256131209" MODIFIED="1537316863454" TEXT="sollten wir das ändern?">
|
||||||
<arrowlink COLOR="#73a3ae" DESTINATION="ID_1088562812" ENDARROW="Default" ENDINCLINATION="255;0;" ID="Arrow_ID_1747758330" STARTARROW="None" STARTINCLINATION="191;47;"/>
|
<arrowlink COLOR="#73a3ae" DESTINATION="ID_1088562812" ENDARROW="Default" ENDINCLINATION="255;0;" ID="Arrow_ID_1747758330" STARTARROW="None" STARTINCLINATION="191;47;"/>
|
||||||
|
<linktarget COLOR="#5174b2" DESTINATION="ID_256131209" ENDARROW="Default" ENDINCLINATION="-241;-10;" ID="Arrow_ID_73536182" SOURCE="ID_507846374" STARTARROW="None" STARTINCLINATION="169;19;"/>
|
||||||
<icon BUILTIN="help"/>
|
<icon BUILTIN="help"/>
|
||||||
<node CREATED="1537230118588" ID="ID_173358506" MODIFIED="1537308994452" TEXT="principle of least surprise">
|
<node CREATED="1537230118588" ID="ID_173358506" MODIFIED="1537308994452" TEXT="principle of least surprise">
|
||||||
<icon BUILTIN="button_ok"/>
|
<icon BUILTIN="button_ok"/>
|
||||||
|
|
@ -31810,8 +31829,8 @@
|
||||||
</node>
|
</node>
|
||||||
</node>
|
</node>
|
||||||
</node>
|
</node>
|
||||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1537309349547" ID="ID_1102778316" MODIFIED="1537309388433" TEXT="bestehende Tests korrigieren">
|
<node COLOR="#338800" CREATED="1537309349547" ID="ID_1102778316" MODIFIED="1537315501823" TEXT="bestehende Tests korrigieren">
|
||||||
<icon BUILTIN="pencil"/>
|
<icon BUILTIN="button_ok"/>
|
||||||
<node COLOR="#338800" CREATED="1537309372867" FOLDED="true" ID="ID_1847253086" MODIFIED="1537312895344" TEXT="verify_simpleUsage">
|
<node COLOR="#338800" CREATED="1537309372867" FOLDED="true" ID="ID_1847253086" MODIFIED="1537312895344" TEXT="verify_simpleUsage">
|
||||||
<icon BUILTIN="button_ok"/>
|
<icon BUILTIN="button_ok"/>
|
||||||
<node CREATED="1537312791212" ID="ID_510039930" MODIFIED="1537312803182" TEXT="weiterer Fehler"/>
|
<node CREATED="1537312791212" ID="ID_510039930" MODIFIED="1537312803182" TEXT="weiterer Fehler"/>
|
||||||
|
|
@ -31819,17 +31838,21 @@
|
||||||
<arrowlink COLOR="#cb8fa1" DESTINATION="ID_665208250" ENDARROW="Default" ENDINCLINATION="55;0;" ID="Arrow_ID_1772260988" STARTARROW="None" STARTINCLINATION="-39;46;"/>
|
<arrowlink COLOR="#cb8fa1" DESTINATION="ID_665208250" ENDARROW="Default" ENDINCLINATION="55;0;" ID="Arrow_ID_1772260988" STARTARROW="None" STARTINCLINATION="-39;46;"/>
|
||||||
</node>
|
</node>
|
||||||
</node>
|
</node>
|
||||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1537309378682" ID="ID_129678233" MODIFIED="1537309381368" TEXT="verify_callLogging">
|
<node COLOR="#338800" CREATED="1537309378682" ID="ID_129678233" MODIFIED="1537315494792" TEXT="verify_callLogging">
|
||||||
|
<icon BUILTIN="button_ok"/>
|
||||||
|
</node>
|
||||||
|
</node>
|
||||||
|
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1537316714860" ID="ID_84746570" MODIFIED="1537316725828" TEXT="Tests zur Klarstellung ergänzen">
|
||||||
<icon BUILTIN="flag-yellow"/>
|
<icon BUILTIN="flag-yellow"/>
|
||||||
</node>
|
</node>
|
||||||
</node>
|
</node>
|
||||||
</node>
|
|
||||||
<node CREATED="1537059402359" ID="ID_1670401833" MODIFIED="1537059407506" TEXT="BusTerm_test"/>
|
<node CREATED="1537059402359" ID="ID_1670401833" MODIFIED="1537059407506" TEXT="BusTerm_test"/>
|
||||||
<node CREATED="1537230718644" ID="ID_1760678465" MODIFIED="1537230724855" TEXT="Fix">
|
<node COLOR="#435e98" CREATED="1537230718644" ID="ID_1760678465" MODIFIED="1537315480594" TEXT="Fix">
|
||||||
<node COLOR="#338800" CREATED="1537230726491" ID="ID_1088562812" MODIFIED="1537309430399" TEXT="before / after gehen stets einen Schritt">
|
<icon BUILTIN="button_ok"/>
|
||||||
|
<node COLOR="#338800" CREATED="1537230726491" ID="ID_1088562812" MODIFIED="1537315479387" TEXT="before / after gehen stets einen Schritt">
|
||||||
<linktarget COLOR="#73a3ae" DESTINATION="ID_1088562812" ENDARROW="Default" ENDINCLINATION="255;0;" ID="Arrow_ID_1747758330" SOURCE="ID_256131209" STARTARROW="None" STARTINCLINATION="191;47;"/>
|
<linktarget COLOR="#73a3ae" DESTINATION="ID_1088562812" ENDARROW="Default" ENDINCLINATION="255;0;" ID="Arrow_ID_1747758330" SOURCE="ID_256131209" STARTARROW="None" STARTINCLINATION="191;47;"/>
|
||||||
<icon BUILTIN="button_ok"/>
|
<icon BUILTIN="button_ok"/>
|
||||||
<node CREATED="1537312702960" HGAP="37" ID="ID_665208250" MODIFIED="1537312886293" VSHIFT="15">
|
<node CREATED="1537312702960" HGAP="37" ID="ID_665208250" MODIFIED="1537315479387" VSHIFT="15">
|
||||||
<richcontent TYPE="NODE"><html>
|
<richcontent TYPE="NODE"><html>
|
||||||
<head>
|
<head>
|
||||||
|
|
||||||
|
|
@ -31862,7 +31885,7 @@
|
||||||
<icon BUILTIN="idea"/>
|
<icon BUILTIN="idea"/>
|
||||||
</node>
|
</node>
|
||||||
</node>
|
</node>
|
||||||
<node COLOR="#338800" CREATED="1537230751079" FOLDED="true" ID="ID_1776084088" MODIFIED="1537309459509" TEXT="neue reine Filter-Funktionen">
|
<node COLOR="#338800" CREATED="1537230751079" FOLDED="true" ID="ID_1776084088" MODIFIED="1537315479388" TEXT="neue reine Filter-Funktionen">
|
||||||
<icon BUILTIN="button_ok"/>
|
<icon BUILTIN="button_ok"/>
|
||||||
<node COLOR="#338800" CREATED="1537230790179" ID="ID_1688121233" MODIFIED="1537308959793" TEXT="wechseln nur den Filter">
|
<node COLOR="#338800" CREATED="1537230790179" ID="ID_1688121233" MODIFIED="1537308959793" TEXT="wechseln nur den Filter">
|
||||||
<icon BUILTIN="button_ok"/>
|
<icon BUILTIN="button_ok"/>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue