keytests: rewritten testcases to use the new searching engine searchPatterns.pl

This commit is contained in:
Kornel Benko 2017-05-24 16:29:32 +02:00
parent 91f3b21e42
commit d547ef7c5e
39 changed files with 260 additions and 137 deletions

View File

@ -1,8 +1,10 @@
# see http://www.lyx.org/trac/ticket/7673#comment:15
#
Lang en_US.utf8
CO: bug-7673.ctrl
TestBegin -dbg key ../bug-7673.lyx > bug-7673.loga.txt 2>&1
# 'outline-in' was needed to reproduce the crash on some commits when bisecting
KK: \Axcommand-sequence repeat 3 char-forward; outline-in; down; down\[Return]
Cp: SIGSEGV
TestEnd
Assert ! pcregrep -M 'SIGSEGV' bug-7673.loga.txt
Assert searchPatterns.pl base=bug-7673

View File

@ -1,6 +1,8 @@
# based on the steps to reproduce #7673 in the original report
#
Lang en_US.utf8
CO: bug-7673b.ctrl
TestBegin -dbg key > bug-7673b.loga.txt 2>&1
KK: \Axcommand-sequence buffer-new; layout Itemize; self-insert a; paragraph-break; depth-increment; self-insert b; up; char-delete-backward; down\[Return]
TestEnd
Assert searchPatterns.pl base=bug-7673b

View File

@ -1,6 +1,8 @@
# .lyx file is from http://www.lyx.org/trac/ticket/8370#comment:8
#
Lang en_US.utf8
CO: bug-8370.ctrl
TestBegin -dbg key ../bug-8370.lyx > bug-8370.loga.txt 2>&1
KK: \Axcommand-sequence change-next; change-reject; change-next\[Return]
TestEnd
Assert searchPatterns.pl base=bug-8370

View File

@ -2,8 +2,10 @@
#
Lang en_US.utf8
CO: bug-8540.ctrl
TestBegin -dbg key > bug-8540.loga.txt 2>&1
KK: \Axlyxrc-apply \\spellchecker enchant\[Return]
KK: \Axlyxrc-apply \\spellchecker enchant\[Return]
Cp: SIGSEGV
TestEnd
Assert ! pcregrep -M 'SIGSEGV' bug-8540.loga.txt
Assert searchPatterns.pl base=bug-8540

View File

@ -1,8 +1,11 @@
Lang en_US.utf8
CO: bug-8684.ctrl
TestBegin -dbg key ../bug-8684.lyx > bug-8684.loga.txt 2>&1
KK: \Axcommand-sequence change-next; change-reject; change-next\[Return]
TestEnd
TestBegin -dbg key ../bug-8684.lyx > bug-8684.logb.txt 2>&1
CO: >> bug-8684.ctrl
TestBegin -dbg key ../bug-8684.lyx >> bug-8684.loga.txt 2>&1
KK: \Axcommand-sequence char-forward; change-next\[Return]
TestEnd
Assert searchPatterns.pl base=bug-8684

View File

@ -4,13 +4,14 @@
#
Lang C
CO: bug-export-latex.ctrl
TestBegin -dbg key,files test.lyx > bug-export-latex.loga.txt 2>&1
KK: \Axinfo-insert icon math-mode\[Return]
KK: \Axbuffer-export luatex\[Return]
KK: \[Tab]\[Return]
KK: \Axbuffer-write\[Return]
KK: \[Tab]\[Return]
Cp: support/FileName.cpp .* creating path '/.*/lib/images'
Cp: support/FileName.cpp .* Checksumming "/.*/lib/images/.*math-mode.pdf" .*lasted
TestEnd
Lang C
Assert ! pcregrep -M "support/FileName.cpp .* creating path '/.*/lib/images'" bug-export-latex.loga.txt
Assert ! pcregrep -M 'support/FileName.cpp .* Checksumming "/.*/lib/images/.*math-mode.pdf" .*lasted ' bug-export-latex.loga.txt
Assert searchPatterns.pl base=bug-export-latex

View File

@ -2,9 +2,10 @@
#
Lang C
CO: bug-math-undo.ctrl
TestBegin -dbg key test.lyx > bug-math-undo.loga.txt 2>&1
KK: \Amm\\frac \\sqrt \Cz
KK: \[Return]
Cp: SIGSEGV
TestEnd
Lang C
Assert ! pcregrep -M 'SIGSEGV' bug-math-undo.loga.txt
Assert searchPatterns.pl base=bug-math-undo

View File

@ -2,6 +2,7 @@
# match should not consider the just replaced text (#4388)
#
Lang it_IT.utf8
CO: findadv-01.ctrl
TestBegin test.lyx -dbg key,find > findadv-01.loga.txt 2>&1
KK: aaa\[Home]
KK: \CF
@ -9,5 +10,7 @@ KK: a\[Tab]
KK: aba\[Return]\[Return]\[Return]
KK: \Cs
KK: \Axbuffer-export latex\[Return]
CR: ^abaabaa$
Lang C
TestEnd grep "^abaabaa$" test.tex
CC:
TestEnd searchPatterns.pl base=findadv-01 log=test.tex

View File

@ -1,6 +1,7 @@
# Basic test on refactoring of mathematics notation
#
Lang it_IT.utf8
CO: findadv-02.ctrl
TestBegin test.lyx -dbg key,find > findadv-02.loga.txt 2>&1
KK: \Cm
KK: x^(a) +\\frac 1+x^(a) \[Down]1-x^(a) \C\[Home]
@ -10,5 +11,7 @@ KK: \Cmx_a
KK: \[Return]\[Return]\[Return]
KK: \Cs
KK: \Axbuffer-export latex\[Return]
CR: ^\$x_\{a\}\+\\frac\{1\+x_\{a\}\}\{1-x\^\{\(a\)\}\}\$$
CC:
Lang C
TestEnd grep '^\$x_{a}+\\frac{1+x_{a}}{1-x\^{(a)}}\$' test.tex
TestEnd searchPatterns.pl base=findadv-02 log=test.tex

View File

@ -1,7 +1,7 @@
#
Lang it_IT.utf8
TestBegin test.lyx -dbg key,find > findadv-03.loga.txt 2>&1
CO: findadv-03.ctrl
TestBegin test.lyx -dbg key,find > findadv-03.loga.txt 2>&1
CN: Part 1
KK: \Cm
KK: x^2 -x^2\C\[Home]
@ -25,4 +25,4 @@ CP: Putting selection at .*idx: 0 par: 0 pos: 0\n.*idx: 0 par: 0 pos: 0\n with l
CP: Putting selection at .*idx: 0 par: 0 pos: 0\n.*idx: 0 par: 0 pos: 2\n with len: 1
TestEnd
Lang C
Assert searchPatterns.pl log=findadv-03.loga.txt patterns=findadv-03.ctrl
Assert searchPatterns.pl base=findadv-03

View File

@ -1,6 +1,7 @@
# Regression test for #7245
#
Lang it_IT.utf8
CO: findadv-04.ctrl
TestBegin test.lyx -dbg key,find > findadv-04.loga.txt 2>&1
KK: \Cm
KK: x^2 \[Return]
@ -13,5 +14,7 @@ KK: \Cm
KK: x^2n\[Return]\[Return]
KK: \Cs
KK: \Axbuffer-export latex\[Return]
CR: ^\$x\^\{2n\}\$$
CC:
Lang C
TestEnd grep '^\$x\^{2n}\$$' test.tex
TestEnd searchPatterns.pl base=findadv-04 log=test.tex

View File

@ -1,8 +1,8 @@
# Basic test for format-aware searching
#
Lang sk_SK.utf8
TestBegin test.lyx -dbg key,find > findadv-05.loga.txt 2>&1
CO: findadv-05.ctrl
TestBegin test.lyx -dbg key,find > findadv-05.loga.txt 2>&1
CN: Part 1
KK: foo \Cefoo foo\Ce foo\C\[Home]
KK: \Cs
@ -20,12 +20,10 @@ KK: \[Escape]\C\[Home]
KK: \CF
KK: \[Delete]
# Unchecked ignore format and emphasised already set
#KK: \At\Ai\Ah
#KK: \Ce
KK: foo\[Return]\[Return]
CP: Putting selection at .*idx: 0 par: 0 pos: 4\n with len: 3
CP: Putting selection at .*idx: 0 par: 0 pos: 8\n with len: 3
TestEnd
Lang C
Assert searchPatterns.pl log=findadv-05.loga.txt patterns=findadv-05.ctrl
Assert searchPatterns.pl base=findadv-05

View File

@ -1,8 +1,8 @@
# Basic test for searching with par-style awareness
Lang sk_SK.utf8
TestBegin test.lyx -dbg key,find > findadv-06.loga.txt 2>&1
CO: findadv-06.ctrl
TestBegin test.lyx -dbg key,find > findadv-06.loga.txt 2>&1
CN: Part 1
KK: foo\[Return]
KK: \Ap2
@ -31,4 +31,4 @@ CP: Putting selection at .*idx: 0 par: 0 pos: 0\n with len: 3
CP: Putting selection at .*idx: 0 par: 2 pos: 0\n with len: 3
TestEnd
Lang C
Assert searchPatterns.pl log=findadv-06.loga.txt patterns=findadv-06.ctrl
Assert searchPatterns.pl base=findadv-06

View File

@ -1,8 +1,8 @@
# Basic test for searching with par-style awareness
Lang sk_SK.utf8
TestBegin test.lyx -dbg key,find > findadv-07.loga.txt 2>&1
CO: findadv-07.ctrl
TestBegin test.lyx -dbg key,find > findadv-07.loga.txt 2>&1
CN: Part 1
KK: foo bar\[Return]
#select itemized
@ -30,4 +30,4 @@ KK: bar\[Return]
CP: Putting selection at .*idx: 0 par: 1 pos: 4\n with len: 3
TestEnd
Lang C
Assert searchPatterns.pl log=findadv-07.loga.txt patterns=findadv-07.ctrl
Assert searchPatterns.pl base=findadv-07

View File

@ -4,9 +4,10 @@ UseShortcut "C-F21" "command-sequence dialog-show findreplaceadv ; buffer-end ;
PrepareShortcuts
#
Lang sk_SK.utf8
TestBegin test.lyx -dbg key,find > findadv-08.loga.txt 2>&1
CO: findadv-08.ctrl
CN: Started findadv-08 1
TestBegin test.lyx -dbg key,find > findadv-08.loga.txt 2>&1
CN: Part 1
Cr: ^.*Putting
CP: Key (queried) [action=buffer-begin][Ctrl+Home]
KK: Nel mezzo del cammin di nostra vita\[Return]
KK: mi ritrovai per una selva oscura\C\[Home]
@ -17,27 +18,28 @@ KK: \C\[F20]
KK: .* a\[Return]
CP: Putting selection at .*idx: 0 par: 0 pos: 8\n with len: 8
#
CN: Started findadv-08 2
CN: Started Part 2
CP: Key (queried) [action=buffer-begin][Ctrl+Home]
KK: \[Escape]\C\[Home]\C\[F21]
KK: o
KK: \C\[F20]
KK: [\\w]* a
KD: 100
# select whole words
KK: \Ae
# search next
KK: \Al
KK: \[Escape]
#KD: 1
KD: 1
Cr: ^.*Putting
CP: Putting selection at .*idx: 0 par: 1 pos: 26\n with len: 6
#
CN: Started findadv-08 3
CN: Part 3
CP: Key (queried) [action=buffer-begin][Ctrl+Home]
KK: \[Escape]\C\[Home]\C\[F21]
KK: \C\[F20]
KK: .*
KK: \Al\Al\Al
KK: \[Return]\[Return]\[Return]
Cr: ^.*Putting
CP: Putting selection at .*idx: 0 par: 0 pos: 0\n with len: 3
Cr: ^.*Putting
@ -46,5 +48,5 @@ Cr: ^.*Putting
CP: Putting selection at .*idx: 0 par: 0 pos: 10\n with len: 3
TestEnd
Lang C
Assert searchPatterns.pl log=findadv-08.loga.txt patterns=findadv-08.ctrl
Assert searchPatterns.pl base=findadv-08

View File

@ -1,8 +1,8 @@
# Test for searching with regular expressions
Lang sk_SK.utf8
TestBegin test.lyx -dbg key,find > findadv-09.loga.txt 2>&1
CO: findadv-09.ctrl
TestBegin test.lyx -dbg key,find > findadv-09.loga.txt 2>&1
CN: Part 1
KK: \Apb
KK: one\[Return]two\[Return]three\C\[Home]\Cs
@ -26,4 +26,4 @@ CP: Putting selection at .*idx: 0 par: 0 pos: 0\n with len: 3
CP: Putting selection at .*idx: 0 par: 1 pos: 0\n with len: 3
TestEnd
Lang C
Assert searchPatterns.pl log=findadv-09.loga.txt patterns=findadv-09.ctrl
Assert searchPatterns.pl base=findadv-09

View File

@ -2,8 +2,8 @@
# when ignoring format
Lang sk_SK.utf8
TestBegin test.lyx -dbg key,find > findadv-10.loga.txt 2>&1
CO: findadv-10.ctrl
TestBegin test.lyx -dbg key,find > findadv-10.loga.txt 2>&1
CN: Part 1
KK: This is LyX,\[Return]
KK: a WYSIWYG LaTeX editor.\C\[Home]
@ -25,4 +25,4 @@ KK: LaTeX\[Return]
CP: Putting selection at .*idx: 0 par: 1 pos: 10\n with len: 5
TestEnd
Lang C
Assert searchPatterns.pl log=findadv-10.loga.txt patterns=findadv-10.ctrl
Assert searchPatterns.pl base=findadv-10

View File

@ -1,8 +1,8 @@
# Inspired by #7363.
#
Lang it_IT.utf8
TestBegin test.lyx -dbg key,find > findadv-11.loga.txt 2>&1
CO: findadv-11.ctrl
TestBegin test.lyx -dbg key,find > findadv-11.loga.txt 2>&1
CN: Part 1
KK: \Cm
KK: x_v \C\[Home]
@ -25,4 +25,4 @@ KK: v\[Return]
CP: Putting selection at .*idx: 0 par: 0 pos: 0\n.*idx: 0 par: 0 pos: 0\n.*idx: 1 par: 0 pos: 0\n with len: 1
TestEnd
Lang C
Assert searchPatterns.pl log=findadv-11.loga.txt patterns=findadv-11.ctrl
Assert searchPatterns.pl base=findadv-11

View File

@ -3,12 +3,14 @@
# (#7442)
#
Lang sk_SK.utf8
CO: findadv-12.ctrl
TestBegin test.lyx -dbg key,find > findadv-12.loga.txt 2>&1
KK: a\C\[Home]
KK: \Cs
KK: \CF
KK: a\[Tab]
KK: \Cm\\bar a \Ar\Ar\An\An\[Left]
Cr: against.*bar
TestEnd
Lang C
Assert ! pcregrep -M 'against.*bar' findadv-12.loga.txt
Assert searchPatterns.pl base=findadv-12

View File

@ -1,6 +1,7 @@
# Finding footnotes
#
Lang it_IT.utf8
CO: findadv-13.ctrl
TestBegin test.lyx -dbg key,find > findadv-13.loga.txt 2>&1
KK: \Axfootnote-insert\[Return]
# Work around a little UI bug/non-determinism in cursor position after LFUN
@ -11,6 +12,7 @@ KK: \Axfootnote-insert\[Return]
# Work around a little UI bug/non-determinism in cursor position after LFUN
KK: \C\[Home]\[Right]
KK: foo\[Return]
CP: Putting selection at .*idx: 0 par: 0 pos: 0\n with len: 1
TestEnd
Lang C
Assert pcregrep -M 'Putting selection at .*idx: 0 par: 0 pos: 0\n with len: 1' findadv-13.loga.txt
Assert searchPatterns.pl base=findadv-13

View File

@ -1,16 +1,18 @@
# Finding displayed maths with ignore-format on&off (might affect #7596)
UseShortcut "C-F23" "math-display"
PrepareShortcuts
#
Lang sk_SK.utf8
TestBegin test.lyx -dbg key,find > findadv-14.loga.txt 2>&1
CO: findadv-14.ctrl
TestBegin test.lyx -dbg key,find > findadv-14.loga.txt 2>&1
CN: Part 1
KK: \Axmath-display\[Return]
KK: \C\[F23]
KK: x^2 +x^2\C\[Home]
KK: \Cs
KK: \CF
# Uncheck ignore format
KK: \At\Ai\Ah
KK: \Axmath-display\[Return]
KK: \C\[F23]
KK: x^2\[Return]
CP: Putting selection at .*idx: 0 par: 0 pos: 0\n.*idx: 0 par: 0 pos: 0\n with len: 1
#
@ -19,7 +21,7 @@ KK: \[Escape]\C\[Home]
CP: Key (queried) [action=buffer-begin][Ctrl+Home]
KK: \CF
KK: \[Delete]
KK: \Axmath-display\[Return]
KK: \C\[F23]
KK: x^2\[Return]\[Return]
CP: Putting selection at .*idx: 0 par: 0 pos: 0\n.*idx: 0 par: 0 pos: 0\n with len: 1
CP: Putting selection at .*idx: 0 par: 0 pos: 0\n.*idx: 0 par: 0 pos: 2\n with len: 1
@ -31,7 +33,7 @@ CP: Key (queried) [action=buffer-begin][Ctrl+Home]
KK: \CF
KK: \[Delete]
KK: \At\Ai\Ah
KK: \Axmath-display\[Return]
KK: \C\[F23]
KK: x^2\[Return]
CP: Putting selection at .*idx: 0 par: 0 pos: 0\n.*idx: 0 par: 0 pos: 0\n with len: 1
@ -41,10 +43,10 @@ KK: \[Escape]\C\[Home]
CP: Key (queried) [action=buffer-begin][Ctrl+Home]
KK: \CF
KK: \[Delete]
KK: \Axmath-display\[Return]
KK: \C\[F23]
KK: x^2\[Return]\[Return]
CP: Putting selection at .*idx: 0 par: 0 pos: 0\n.*idx: 0 par: 0 pos: 0\n with len: 1
CP: Putting selection at .*idx: 0 par: 0 pos: 0\n.*idx: 0 par: 0 pos: 2\n with len: 1
TestEnd
Lang C
Assert searchPatterns.pl log=findadv-14.loga.txt patterns=findadv-14.ctrl
Assert searchPatterns.pl base=findadv-14

View File

@ -1,16 +1,19 @@
# Finding numbered maths with ignore-format on&off (might affect #7596)
UseShortcut "C-F21" "command-sequence dialog-show findreplaceadv ; buffer-end ; buffer-begin-select ; char-delete-forward ;"
UseShortcut "C-F22" "command-sequence math-mode ; math-number-toggle ;"
PrepareShortcuts
#
Lang sk_SK.utf8
TestBegin test.lyx -dbg key,find > findadv-15.loga.txt 2>&1
CO: findadv-15.ctrl
TestBegin test.lyx -dbg key,find > findadv-15.loga.txt 2>&1
CN: Part 1
KK: \CM\Axmath-number-toggle\[Return]
KK: \C\[F22]
KK: x^2 +x^2\C\[Home]
KK: \Cs
KK: \CF
# Uncheck ignore format
KK: \At\Ai\Ah
KK: \CM\Axmath-number-toggle\[Return]
KK: \C\[F22]
KK: x^2\[Return]
CP: Putting selection at .*idx: 0 par: 0 pos: 0\n.*idx: 0 par: 0 pos: 0\n with len: 1
@ -19,7 +22,7 @@ KK: \[Escape]\C\[Home]
CP: Key (queried) [action=buffer-begin][Ctrl+Home]
KK: \CF
KK: \[Delete]
KK: \CM\Axmath-number-toggle\[Return]
KK: \C\[F22]
KK: x^2\[Return]\[Return]
CP: Putting selection at .*idx: 0 par: 0 pos: 0\n .*idx: 0 par: 0 pos: 0\n with len: 1
CP: Putting selection at .*idx: 0 par: 0 pos: 0\n.*idx: 0 par: 0 pos: 2\n with len: 1
@ -32,7 +35,7 @@ KK: \CF
KK: \[Delete]
# Check ignore format (was unchecked)
KK: \At\Ai\Ah
KK: \CM\Axmath-number-toggle\[Return]
KK: \C\[F22]
KK: x^2\[Return]
CP: Putting selection at .*idx: 0 par: 0 pos: 0\n.*idx: 0 par: 0 pos: 0\n with len: 1
@ -41,11 +44,11 @@ KK: \[Escape]\C\[Home]
CP: Key (queried) [action=buffer-begin][Ctrl+Home]
KK: \CF
KK: \[Delete]
KK: \CM\Axmath-number-toggle\[Return]
KK: \C\[F22]
KK: x^2\[Return]\[Return]
CP: Putting selection at .*idx: 0 par: 0 pos: 0\n .*idx: 0 par: 0 pos: 0\n with len: 1
CP: Putting selection at .*idx: 0 par: 0 pos: 0\n.*idx: 0 par: 0 pos: 2\n with len: 1
TestEnd
Lang C
Assert searchPatterns.pl log=findadv-15.loga.txt patterns=findadv-15.ctrl
Assert searchPatterns.pl base=findadv-15

View File

@ -1,31 +1,36 @@
# Verify matches in *-environments with ignore-format off
# (gather environment comes in the *-form after mutate)
UseShortcut "C-F24" "math-mutate gather"
UseShortcut "C-F21" "command-sequence dialog-show findreplaceadv ; buffer-end ; buffer-begin-select ; char-delete-forward ;"
PrepareShortcuts
#
Lang sk_SK.utf8
TestBegin test.lyx -dbg key,find > findadv-16.loga.txt 2>&1
CO: findadv-16.ctrl
TestBegin test.lyx -dbg key,find > findadv-16.loga.txt 2>&1
CN: Part 1
KK: \CM\Axmath-mutate gather\[Return]
KK: \CM\C\[F24]
KK: x^2 +x^2\C\[Home]
KK: \Cs
KK: \CF
# Uncheck ignore format
KK: \At\Ai\Ah
KK: \CM\Axmath-mutate gather\[Return]
KK: \CM\C\[F24]
KK: x^2\[Return]
Cr: ^.*Putting
CP: Putting selection at .*idx: 0 par: 0 pos: 0\n.*idx: 0 par: 0 pos: 0\n with len: 1
#
CN: Part 2
KK: \[Escape]\C\[Home]
CP: Key (queried) [action=buffer-begin][Ctrl+Home]
KK: \CF
KK: \[Delete]
KK: \CM\Axmath-mutate gather\[Return]
KK: \C\[F21]
KK: \CM\C\[F24]
KK: x^2\[Return]\[Return]
Cr: ^.*Putting
CP: Putting selection at .*idx: 0 par: 0 pos: 0\n.*idx: 0 par: 0 pos: 0\n with len: 1
Cr: ^.*Putting
CP: Putting selection at .*idx: 0 par: 0 pos: 0\n.*idx: 0 par: 0 pos: 2\n with len: 1
TestEnd
Lang C
Assert searchPatterns.pl log=findadv-16.loga.txt patterns=findadv-16.ctrl
Assert searchPatterns.pl base=findadv-16

View File

@ -1,8 +1,8 @@
# Finding consecutive macros in math mode
#
Lang it_IT.utf8
TestBegin test.lyx -dbg key,find > findadv-17.loga.txt 2>&1
CO: findadv-17.ctrl
TestBegin test.lyx -dbg key,find > findadv-17.loga.txt 2>&1
CN: Part 1
KK: \Cm\\alpha\\beta\\alpha \C\[Home]
KK: \Cs
@ -22,4 +22,4 @@ KK: \Cm\\beta\\alpha \[Return]
CP: Putting selection at .*idx: 0 par: 0 pos: 0\n.*idx: 0 par: 0 pos: 1\n with len: 2
TestEnd
Lang C
Assert searchPatterns.pl log=findadv-17.loga.txt patterns=findadv-17.ctrl
Assert searchPatterns.pl base=findadv-17

View File

@ -1,11 +1,13 @@
# Searching for regexp with e.g. \[Backspace]\[Backspace]s finds blanks
Lang it_IT.utf8
CO: findadv-18.ctrl
TestBegin test.lyx -dbg key,find > findadv-18.loga.txt 2>&1
KK: a b c\C\[Home]
KK: \Cs
KK: \CF
KK: \Axregexp-mode\[Return]\\s\[Return]
CP: Putting selection at .*idx: 0 par: 0 pos: 1\n with len: 1
TestEnd
Lang C
Assert pcregrep -M 'Putting selection at .*idx: 0 par: 0 pos: 1\n with len: 1' findadv-18.loga.txt
Assert searchPatterns.pl base=findadv-18

View File

@ -1,11 +1,13 @@
# Check that searching for regexp "([a-z]+)\s\1" finds duplicate words.
Lang it_IT.utf8
CO: findadv-19.ctrl
TestBegin test.lyx -dbg key,find > findadv-19.loga.txt 2>&1
KK: Hello world world!\C\[Home]
KK: \Cs
KK: \CF
KK: \Axregexp-mode\[Return]([a-z]+)\\s\\1\[Return]
CP: Putting selection at .*idx: 0 par: 0 pos: 6\n with len: 11
TestEnd
Lang C
Assert pcregrep -M 'Putting selection at .*idx: 0 par: 0 pos: 6\n with len: 11' findadv-19.loga.txt
Assert searchPatterns.pl base=findadv-19

View File

@ -3,8 +3,8 @@
#
Lang it_IT.utf8
TestBegin test.lyx -dbg key,find > findadv-20.loga.txt 2>&1
CO: findadv-20.1.ctrl
TestBegin test.lyx -dbg key,find > findadv-20.loga.txt 2>&1
CN: Part 1
KK: a a a\C\[Home]
KK: \CF
@ -13,11 +13,12 @@ KK: \Cm\\frac 1\[Down]a\[Return]\[Return]\[Return]
KK: \Cs
KK: \Axbuffer-export latex\[Return]
CR: \$\\frac\{1\}\{a\}\$ \$\\frac\{1\}\{a\}\$ a
CC:
TestEnd
Lang it_IT.utf8
TestBegin test2.lyx -dbg key,find > findadv-20.logb.txt 2>&1
CO: findadv-20.2.ctrl
TestBegin test2.lyx -dbg key,find > findadv-20.logb.txt 2>&1
CN: Part 2
KK: \Cma \Cma \Cma \C\[Home]
KK: \CF
@ -26,6 +27,7 @@ KK: \Cm\\frac 1\[Down]a\[Return]\[Return]\[Return]
KK: \Cs
KK: \Axbuffer-export latex\[Return]
CR: ^\$\\frac\{1\}\{a\}\$ \$\\frac\{1\}\{a\}\$ \$a\$
CC:
TestEnd
Lang C
Assert searchPatterns.pl log=test.tex patterns=findadv-20.1.ctrl

View File

@ -2,6 +2,7 @@
# Test for #8381
Lang sk_SK.utf8
CO: findadv-21.ctrl
TestBegin test.lyx -dbg key,find > findadv-21.loga.txt 2>&1
KK: \Apb
KK: one\[Return]
@ -21,18 +22,23 @@ KK: \CF
# Uncheck ignore format
KK: \At\Ai\Ah
KK: \Ape
KK: \Axregexp-mode\[Return][a-z]* \[Return]
TestEnd
Lang C
Assert pcregrep -M 'Putting selection at cur= inset: .* idx: 0 par: 3 pos: 0\n with len: 4' findadv-21.loga.txt
KK: \Axregexp-mode\[Return][a-z]* \[Return]\[Return]\[Return]\[Return]\[Return]
Cr: ^.*Putting
Cr: ^.*action=buffer-begin
CP: Putting selection at cur= inset: .* idx: 0 par: 3 pos: 0\n with len: 4
Lang sk_SK.utf8
TestBegin test.lyx -dbg key,find > findadv-21.logb.txt 2>&1
KK: \CF
KK: \[Escape]\[Escape]\C\[Home]
Cr: ^.*Putting
CP: Key (queried) [action=buffer-begin][Ctrl+Home]
KK: \CF\[Delete]
# Uncheck ignore format
KK: \At\Ai\Ah
KK: \Apd
KK: \Axregexp-mode\[Return][a-z]*\\s+[a-z]* \[Return]\[Return]
#KK: \At\Ai\Ah
KK: \Apl
KK: \Axregexp-mode\[Return][a-z]2 \Axregexp-mode\[Return][a-z]*
KK: \[Return]\[Return]\[Return]\[Return]\[Return]\[Return]
Cr: ^.*Putting
CP: Putting selection at cur= inset: .* idx: 0 par: 6 pos: 0\n with len: 8
TestEnd
Lang C
Assert pcregrep -M 'Putting selection at cur= inset: .* idx: 0 par: 7 pos: 3\n with len: 6' findadv-21.logb.txt
Assert searchPatterns.pl base=findadv-21

View File

@ -4,8 +4,8 @@ UseShortcut "C-F21" "command-sequence dialog-show findreplaceadv ; buffer-end ;
PrepareShortcuts
#
Lang sk_SK.utf8
TestBegin test.lyx -dbg key,find > findadv-combined.loga.txt 2>&1
CO: findadv-combined.ctrl
TestBegin test.lyx -dbg key,find > findadv-combined.loga.txt 2>&1
CP: Key (queried) [action=buffer-begin][Ctrl+Home]
# String to be checked
KK: \\()[]{}%^#@?*.\[Return]
@ -143,4 +143,4 @@ CP: Putting selection at .*idx: 0 par: 4 pos: 10\n with len: 1
#
TestEnd
Lang C
Assert searchPatterns.pl log=findadv-combined.loga.txt patterns=findadv-combined.ctrl
Assert searchPatterns.pl base=findadv-combined

View File

@ -2,9 +2,14 @@
# Crash in using function 'word-findadv'
Lang C
CO: findadv-crash.ctrl
TestBegin test.lyx -dbg key,find > findadv-crash.loga.txt 2>&1
KK: abcd
KK: \Axword-findadv a\[Return]
CP: action=command-execute
Cr: SIGSEGV signal caught
CP: action=lyx-quit
TestEnd
Lang C
Assert ! pcregrep 'SIGSEGV signal caught' findadv-crash.loga.txt
Assert searchPatterns.pl log=findadv-crash.loga.txt patterns=findadv-crash.ctrl

View File

@ -12,6 +12,7 @@ KK: \CF
KK: \At\Ai\Ah
KK: \Axspecialchar-insert lyx\[Return]\[Tab]
KK: \Axspecialchar-insert latex\[Return]\Al\Ar\An
KK: \[Tab]\[Return]
TestEnd
Lang C
Assert pcregrep -M 'Putting selection at .*idx: 0 par: 0 pos: 29\n with len: 1' findadv-logo.loga.txt

View File

@ -1,41 +1,48 @@
# Finding special latex/regexp chars: (
#
Lang it_IT.utf8
CO: findadv-re-01.ctrl
TestBegin test.lyx -dbg key,find > findadv-re-01.loga.txt 2>&1
CN: Part 1
KK: \\()[]{}%^#@?*.\C\[Home]
KK: \Cs
KK: \CF
KK: \Axregexp-mode\[Return]\\(\[Return]
CP: Putting selection at .*idx: 0 par: 0 pos: 1\n with len: 1
TestEnd
Lang C
Assert pcregrep -M 'Putting selection at .*idx: 0 par: 0 pos: 1\n with len: 1' findadv-re-01.loga.txt
#
Lang sk_SK.utf8
TestBegin test.lyx -dbg key,find > findadv-re-01.logb.txt 2>&1
CO: >> findadv-re-01.ctrl
TestBegin test.lyx -dbg key,find >> findadv-re-01.loga.txt 2>&1
CN: Part 2
KK: \CF
# Uncheck ignore format
KK: \At\Ai\Ah
KK: \Axregexp-mode\[Return]\\(\[Return]
CP: Putting selection at .*idx: 0 par: 0 pos: 1\n with len: 1
TestEnd
Lang C
Assert pcregrep -M 'Putting selection at .*idx: 0 par: 0 pos: 1\n with len: 1' findadv-re-01.logb.txt
# Finding special latex/regexp chars: [
#
Lang it_IT.utf8
TestBegin test.lyx -dbg key,find > findadv-re-01.logc.txt 2>&1
CO: >> findadv-re-01.ctrl
TestBegin test.lyx -dbg key,find >> findadv-re-01.loga.txt 2>&1
CN: Part 3
KK: \CF
KK: \Axregexp-mode\[Return]\\[\[Return]
CP: Putting selection at .*idx: 0 par: 0 pos: 3\n with len: 1
TestEnd
Lang C
Assert pcregrep -M 'Putting selection at .*idx: 0 par: 0 pos: 3\n with len: 1' findadv-re-01.logc.txt
#
Lang sk_SK.utf8
TestBegin test.lyx -dbg key,find > findadv-re-01.logd.txt 2>&1
CO: >> findadv-re-01.ctrl
TestBegin test.lyx -dbg key,find >> findadv-re-01.loga.txt 2>&1
CN: Part 4
KK: \CF
# Uncheck ignore format
KK: \At\Ai\Ah
KK: \Axregexp-mode\[Return]\\[\[Return]
CP: Putting selection at .*idx: 0 par: 0 pos: 3\n with len: 1
TestEnd
Lang C
Assert pcregrep -M 'Putting selection at .*idx: 0 par: 0 pos: 3\n with len: 1' findadv-re-01.logd.txt
Assert searchPatterns.pl base=findadv-re-01

View File

@ -1,61 +1,69 @@
# Finding special latex/regexp chars: \
#
Lang it_IT.utf8
CO: findadv-re-02.ctrl
TestBegin test.lyx -dbg key,find > findadv-re-02.loga.txt 2>&1
CN: Part 1
KK: \\()[]{}%^#@?*.\C\[Home]
KK: \Cs
KK: \CF
KK: \Axregexp-mode\[Return]\\\\\[Return]
CP: Putting selection at .*idx: 0 par: 0 pos: 0\n with len: 1
TestEnd
Lang C
Assert pcregrep -M 'Putting selection at .*idx: 0 par: 0 pos: 0\n with len: 1' findadv-re-02.loga.txt
#
Lang sk_SK.utf8
TestBegin test.lyx -dbg key,find > findadv-re-02.logb.txt 2>&1
CO: >> findadv-re-02.ctrl
TestBegin test.lyx -dbg key,find >> findadv-re-02.loga.txt 2>&1
CN: Part 2
KK: \CF
# Uncheck ignore format
KK: \At\Ai\Ah
KK: \Axregexp-mode\[Return]\\\\\[Return]
CP: Putting selection at .*idx: 0 par: 0 pos: 0\n with len: 1
TestEnd
Lang C
Assert pcregrep -M 'Putting selection at .*idx: 0 par: 0 pos: 0\n with len: 1' findadv-re-02.logb.txt
# Finding special latex/regexp chars: %
#
Lang it_IT.utf8
TestBegin test.lyx -dbg key,find > findadv-re-02.logc.txt 2>&1
TestBegin test.lyx -dbg key,find >> findadv-re-02.loga.txt 2>&1
CN: Part 3
CO: >> findadv-re-02.ctrl
KK: \CF
KK: \Axregexp-mode\[Return]%\[Return]
CP: Putting selection at .*idx: 0 par: 0 pos: 7\n with len: 1
TestEnd
Lang C
Assert pcregrep -M 'Putting selection at .*idx: 0 par: 0 pos: 7\n with len: 1' findadv-re-02.logc.txt
#
Lang sk_SK.utf8
TestBegin test.lyx -dbg key,find > findadv-re-02.logd.txt 2>&1
CO: >> findadv-re-02.ctrl
TestBegin test.lyx -dbg key,find >> findadv-re-02.loga.txt 2>&1
CN: Part 4
KK: \CF
# Uncheck ignore format
KK: \At\Ai\Ah
KK: \Axregexp-mode\[Return]%\[Return]
CP: Putting selection at .*idx: 0 par: 0 pos: 7\n with len: 1
TestEnd
Lang C
Assert pcregrep -M 'Putting selection at .*idx: 0 par: 0 pos: 7\n with len: 1' findadv-re-02.logd.txt
# Finding special latex/regexp chars: ^
#
Lang it_IT.utf8
TestBegin test.lyx -dbg key,find > findadv-re-02.loge.txt 2>&1
CO: >> findadv-re-02.ctrl
TestBegin test.lyx -dbg key,find >> findadv-re-02.loga.txt 2>&1
CN: Part 5
KK: \CF
KK: \Axregexp-mode\[Return]\\^\[Return]
CP: Putting selection at .*idx: 0 par: 0 pos: 8\n with len: 1
TestEnd
Lang C
Assert pcregrep -M 'Putting selection at .*idx: 0 par: 0 pos: 8\n with len: 1' findadv-re-02.loge.txt
#
Lang sk_SK.utf8
TestBegin test.lyx -dbg key,find > findadv-re-02.logf.txt 2>&1
CO: >> findadv-re-02.ctrl
TestBegin test.lyx -dbg key,find >> findadv-re-02.loga.txt 2>&1
CN: Part 6
KK: \CF
# Uncheck ignore format
KK: \At\Ai\Ah
KK: \Axregexp-mode\[Return]\\^\[Return]
CP: Putting selection at .*idx: 0 par: 0 pos: 8\n with len: 1
TestEnd
Lang C
Assert pcregrep -M 'Putting selection at .*idx: 0 par: 0 pos: 8\n with len: 1' findadv-re-02.logf.txt
Assert searchPatterns.pl base=findadv-re-02

View File

@ -1,41 +1,47 @@
# Finding special latex/regexp chars: {
#
Lang it_IT.utf8
CO: findadv-re-03.ctrl
TestBegin test.lyx -dbg key,find > findadv-re-03.loga.txt 2>&1
CN: Part 1
KK: \\()[]{}%^#@?*.\C\[Home]
KK: \Cs
KK: \CF
KK: \Axregexp-mode\[Return]\\{\[Return]
CP: Putting selection at .*idx: 0 par: 0 pos: 5\n with len: 1
TestEnd
Lang C
Assert pcregrep -M 'Putting selection at .*idx: 0 par: 0 pos: 5\n with len: 1' findadv-re-03.loga.txt
#
Lang sk_SK.utf8
TestBegin test.lyx -dbg key,find > findadv-re-03.logb.txt 2>&1
CO: >> findadv-re-03.ctrl
TestBegin test.lyx -dbg key,find >> findadv-re-03.loga.txt 2>&1
CN: Part 2
KK: \CF
# Uncheck ignore format
KK: \At\Ai\Ah
KK: \Axregexp-mode\[Return]\\{\[Return]
CP: Putting selection at .*idx: 0 par: 0 pos: 5\n with len: 1
TestEnd
Lang C
Assert pcregrep -M 'Putting selection at .*idx: 0 par: 0 pos: 5\n with len: 1' findadv-re-03.logb.txt
#
# Finding special latex/regexp chars: }
#
Lang it_IT.utf8
TestBegin test.lyx -dbg key,find > findadv-re-03.logc.txt 2>&1
CO: >> findadv-re-03.ctrl
TestBegin test.lyx -dbg key,find >> findadv-re-03.loga.txt 2>&1
CN: Part 3
KK: \CF
KK: \Axregexp-mode\[Return]\\}\[Return]
CP: Putting selection at .*idx: 0 par: 0 pos: 6\n with len: 1
TestEnd
Lang C
Assert pcregrep -M 'Putting selection at .*idx: 0 par: 0 pos: 6\n with len: 1' findadv-re-03.logc.txt
#
Lang sk_SK.utf8
TestBegin test.lyx -dbg key,find > findadv-re-03.logd.txt 2>&1
CO: >> findadv-re-03.ctrl
TestBegin test.lyx -dbg key,find >> findadv-re-03.loga.txt 2>&1
CN: Part 4
KK: \CF
# Uncheck ignore format
KK: \At\Ai\Ah
KK: \Axregexp-mode\[Return]\\}\[Return]
CP: Putting selection at .*idx: 0 par: 0 pos: 6\n with len: 1
TestEnd
Lang C
Assert pcregrep -M 'Putting selection at .*idx: 0 par: 0 pos: 6\n with len: 1' findadv-re-03.logd.txt
Assert searchPatterns.pl base=findadv-re-03

View File

@ -6,7 +6,7 @@ CN: Part 1
CP: Init key
TestBegin test.lyx -dbg key,find > findadv-re-04.loga.txt 2>&1
CP: Key (queried) [action=buffer-begin][Ctrl+Home]
KK: The quick Brown \CeFox JUmps\Ce over the lazy Dog\[Return]
KK: The quick Brown \CeFox jUMps\Ce over the lazy Dog\[Return]
KK: \C\[Home]
KK: \Cs
KK: \CF
@ -17,6 +17,7 @@ CN: Case insensitive, format not ignored .*
KK: \Axregexp-mode\[Return].*\[Return]
Cr: ^.*Putting
CP: Putting selection at .*idx: 0 par: 0 pos: 16\n with len: 9
Cr: ^.*Putting
TestEnd
CO: >> findadv-re-04.ctrl
@ -33,6 +34,7 @@ Cr: ^.*Putting
CP: Putting selection at .*idx: 0 par: 0 pos: 16\n with len: 3
Cr: ^.*Putting
CP: Putting selection at .*idx: 0 par: 0 pos: 20\n with len: 5
Cr: ^.*Putting
TestEnd
CO: >> findadv-re-04.ctrl
@ -49,7 +51,11 @@ Cr: ^.*Putting
CP: Putting selection at .*idx: 0 par: 0 pos: 17\n with len: 2
Cr: ^.*Putting
Cr: ^.*Init key
CP: Putting selection at .*idx: 0 par: 0 pos: 22\n with len: 3
CP: Putting selection at .*idx: 0 par: 0 pos: 20\n with len: 1
Cr: ^.*Putting
Cr: ^.*Init key
CP: Putting selection at .*idx: 0 par: 0 pos: 23\n with len: 2
Cr: ^.*Putting
TestEnd
CO: >> findadv-re-04.ctrl
@ -61,11 +67,12 @@ CN: Case sensitive, format not ignored [A-Z]*
KK: \CF
KK: \At\Ai\Ah
KK: \Ce
KK: \Ao\[Tab]\Axregexp-mode\[Return][A-Z]*\[Return]\[Return]\[Return]\[Return]\[Return]
KK: \Ao\[Tab]\Axregexp-mode\[Return][A-Z]*\[Return]\[Return]\[Return]\[Return]\[Return]\[Return]
Cr: ^.*Putting
CP: Putting selection at .*idx: 0 par: 0 pos: 16\n with len: 1
Cr: ^.*Putting
CP: Putting selection at .*idx: 0 par: 0 pos: 20\n with len: 2
CP: Putting selection at .*idx: 0 par: 0 pos: 21\n with len: 2
Cr: ^.*Putting
TestEnd
Lang C
Assert searchPatterns.pl log=findadv-re-04.loga.txt patterns=findadv-re-04.ctrl
Assert searchPatterns.pl base=findadv-re-04

View File

@ -9,13 +9,12 @@
# ask if the cursor started at the beginning of the buffer).
Lang it_IT.utf8
CO: findadv-re-05.ctrl
TestBegin test.lyx -dbg key,find > findadv-re-05.loga.txt 2>&1
KK: \Cm\\frac 1-x\[Down]1+x^2 \C\[Home]
KK: \CF
KK: \Cm\\frac \Axregexp-mode\[Return].* \[Down]1+x^2 \[Return]
# After the message about reaching the end of buffer, lyx
# loses focus :(
# so no more keys can be sent to lyx
TestEndWithKill
CP: raggiunta la fine cercando in avanti
TestEnd
Lang C
Assert pcregrep 'raggiunta la fine cercando in avanti' findadv-re-05.loga.txt
Assert searchPatterns.pl base=findadv-re-05

View File

@ -1,12 +1,14 @@
# Finding regexps within \frac{}
Lang sk_SK.utf8
CO: findadv-re-06.ctrl
TestBegin test.lyx -dbg key,find > findadv-re-06.loga.txt 2>&1
KK: \Cm\\frac 1-x\[Down]1+x^2 \C\[Home]
KK: \CF
# Uncheck ignore format (depends on IT language)
KK: \At\Ai\Ah
KK: \Cm\\frac \Axregexp-mode\[Return].* \[Down]1+x^2 \[Return]
CP: Putting selection at .*idx: 0 par: 0 pos: 0\n .*idx: 0 par: 0 pos: 0\n with len: 1
TestEnd
Lang C
Assert pcregrep -M 'Putting selection at .*idx: 0 par: 0 pos: 0\n .*idx: 0 par: 0 pos: 0\n with len: 1' findadv-re-06.loga.txt
Assert searchPatterns.pl base=findadv-re-06

View File

@ -19,9 +19,11 @@ sub convertPattern($); # check for regex, comment
sub convertSimplePattern($); # escape some chars, (e.g. ']' ==> '\]')
sub printInvalid($$); # display lines which should not match
my ($logfile, $patternsfile, $basename, $newbase) = (undef, undef, undef);
my %options = (
"log" => undef,
"patterns" => undef,
"log" => \$logfile,
"patterns" => \$patternsfile,
"base" => \$basename,
);
my @patterns = ();
@ -33,11 +35,27 @@ for my $arg (@ARGV) {
if ($arg =~ /^([^=]+)=(.+)$/) {
my ($what, $val) = ($1, $2);
if (exists($options{$what})) {
if (defined($options{$what})) {
print "Value for \"$what\" already defined\n";
if (defined(${$options{$what}})) {
print "Param \"$what\" already handled\n";
sexit(1);
}
${$options{$what}} = $val;
if ($what ne "base") {
if ($what eq "log") {
if ($logfile =~ /^(.+)\.log[a-z]?\.txt$/) {
$newbase = $1;
}
}
elsif ($what eq "patterns") {
if ($patternsfile =~ /^(.+)\.ctrl$/) {
$newbase = $1;
}
}
else {
print "Software error, unhandled param \"$what\"\n";
&sexit(1);
}
$options{$what} = $val;
}
}
else {
print "Unknown param \"$what\"\n";
@ -50,19 +68,37 @@ for my $arg (@ARGV) {
}
}
$basename = $newbase if (! defined($basename));
if (defined($basename)) {
for my $k (keys %options) {
next if ($k eq "base");
if (! defined(${$options{$k}})) {
if ($k eq "log") {
$logfile = $basename . ".loga.txt";
}
elsif ($k eq "patterns") {
$patternsfile = $basename . ".ctrl";
}
}
}
}
for my $k (keys %options) {
if (! defined($options{$k})) {
next if ($k eq "base");
if (! defined(${$options{$k}})) {
print "Param \"$k\" not defined\n";
&sexit(1);
}
if (! -r $options{$k}) {
print "File \"$options{$k}\" is not readable\n";
if (! -r ${$options{$k}}) {
print "File \"${$options{$k}}\" is not readable\n";
&sexit(1);
}
}
# Read patterns
&readPatterns($options{"patterns"});
if (&processLogFile($options{"log"}) > 0) {
print "\nControlfile\t= $patternsfile\n";
print "Log-file\t= $logfile\n\n";
&readPatterns($patternsfile);
if (&processLogFile($logfile) > 0) {
print "Errors occured, exiting\n";
exit(1);
}
@ -74,7 +110,9 @@ sub syntax()
print "Syntax:\n";
print " $0";
for my $k (keys %options) {
print " $k=<filename>";
my $type = "filename";
$type = "basename" if ($k eq "base");
print " \[$k=<$type>\]";
}
print "\n";
}

View File

@ -2,8 +2,10 @@
# (http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg167716.html)
#
Lang it_IT.utf8
CO: tabular-footnote.ctrl
TestBegin test.lyx -dbg key > tabular-footnote.loga.txt 2>&1
KK: \Axtabular-insert 1 1\[Return]\[Left]
KK: \Axinset-modify tabular align-decimal\[Return]
KK: \Axfootnote-insert\[Return]
TestEnd
Assert searchPatterns.pl base=tabular-footnote