From 7409b5e18aabd01ee3dd08c47801032ceaeb6374 Mon Sep 17 00:00:00 2001 From: Scott Kostyshak Date: Mon, 24 Feb 2014 07:57:02 -0500 Subject: [PATCH] Fix a broken autotest This test was broken after wrap-around search was implemented. From what I understand, the point of the test is that search should _not_ match in this case because "ignore format" is checked by default. Thus, a new way of testing that there was no match is to check whether the wrap around message shows up, because the cursor is initially at the beginning so that would mean that the entire buffer was checked. I confirmed that the test now works by checking that it passes and checking that it fails if "ignore format" is unchecked. Although this test is still fragile, it is fragile in a conservative way (i.e. it will give false failures rather than false passes). It will fail if the Italian translation changes, if "ignore format" is unchecked by default, or if the wrap-around mechanism changes (e.g. does not ask if the cursor started at the beginning of the buffer). --- development/autotests/findadv-re-05-in.txt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/development/autotests/findadv-re-05-in.txt b/development/autotests/findadv-re-05-in.txt index d1293bac17..20c0b7cf73 100644 --- a/development/autotests/findadv-re-05-in.txt +++ b/development/autotests/findadv-re-05-in.txt @@ -1,4 +1,12 @@ # Finding regexps within \frac{} +# From what I understand, the point of the test is that search should _not_ +# match in this case because "ignore format" is checked by default. Thus, a +# way of testing that there was no match is to check whether the wrap around +# message shows up, because the cursor is initially at the beginning so that +# would mean that the entire buffer was checked. This test is still fragile: +# It will fail if the Italian translation changes, if "ignore format" is +# unchecked by default, or if the wrap-around mechanism changes (e.g. does not +# ask if the cursor started at the beginning of the buffer). Lang it_IT.utf8 TestBegin test.lyx -dbg find > lyx-log.txt 2>&1 @@ -6,4 +14,4 @@ KK: \Cm\\frac 1-x\[Down]1+x^2 \C\[Home] KK: \CF KK: \Cm\\frac \Axregexp-mode\[Return].* \[Down]1+x^2 \[Return] TestEnd -Assert pcregrep -M 'Putting selection at .*idx: 0 par: 0 pos: 0\n .*idx: 0 par: 0 pos: 0\n with len: 1' lyx-log.txt +Assert pcregrep 'raggiunta la fine cercando in avanti' lyx-log.txt -- 2.39.2