From 5146fc75cfbb2ab1a1950ff73def1afad8fa2928 Mon Sep 17 00:00:00 2001 From: Jean-Francois Dockes Date: Thu, 1 Oct 2020 09:30:02 +0200 Subject: [PATCH] more tests --- tests/duplicates/duplicates.sh | 17 +++++++++++++++++ tests/duplicates/duplicates.txt | 10 ++++++++++ tests/fb2/fb2.sh | 14 ++++++++++++++ tests/fb2/fb2.txt | 2 ++ tests/kword/kword.sh | 15 +++++++++++++++ tests/kword/kword.txt | 4 ++++ tests/runtests.sh | 2 ++ tests/webarchives/webarchives.sh | 16 ++++++++++++++++ tests/webarchives/webarchives.txt | 6 ++++++ tests/wordperfect/wordperfect.sh | 14 ++++++++++++++ tests/wordperfect/wordperfect.txt | 2 ++ 11 files changed, 102 insertions(+) create mode 100755 tests/duplicates/duplicates.sh create mode 100644 tests/duplicates/duplicates.txt create mode 100755 tests/fb2/fb2.sh create mode 100644 tests/fb2/fb2.txt create mode 100755 tests/kword/kword.sh create mode 100644 tests/kword/kword.txt create mode 100755 tests/webarchives/webarchives.sh create mode 100644 tests/webarchives/webarchives.txt create mode 100755 tests/wordperfect/wordperfect.sh create mode 100644 tests/wordperfect/wordperfect.txt diff --git a/tests/duplicates/duplicates.sh b/tests/duplicates/duplicates.sh new file mode 100755 index 00000000..5fd85c1d --- /dev/null +++ b/tests/duplicates/duplicates.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +topdir=`dirname $0`/.. +. $topdir/shared.sh + +initvariables $0 + +( +recollq -S url -C -q duplicate_uniqueterm +recollq -S url -q duplicate_uniqueterm +recollq -S url -C -q '"STARTTLS is supported in both POP and IMAP"' +recollq -S url -q '"STARTTLS is supported in both POP and IMAP"' +) 2> $mystderr | egrep -v '^Recoll query: ' > $mystdout + +diff -w ${myname}.txt $mystdout > $mydiffs 2>&1 + +checkresult diff --git a/tests/duplicates/duplicates.txt b/tests/duplicates/duplicates.txt new file mode 100644 index 00000000..81398190 --- /dev/null +++ b/tests/duplicates/duplicates.txt @@ -0,0 +1,10 @@ +1 results +text/plain [file:///home/dockes/projets/fulltext/testrecoll/duplicates/copy1.txt] [copy1.txt] 21 bytes +2 results +text/plain [file:///home/dockes/projets/fulltext/testrecoll/duplicates/copy1.txt] [copy1.txt] 21 bytes +text/plain [file:///home/dockes/projets/fulltext/testrecoll/duplicates/copy2.txt] [copy2.txt] 21 bytes +1 results +text/html [file:///home/dockes/projets/fulltext/testrecoll/duplicates/fetchmail-features.html] [Fetchmail Feature List] 9184 bytes +2 results +text/html [file:///home/dockes/projets/fulltext/testrecoll/duplicates/fetchmail-features.html] [Fetchmail Feature List] 9184 bytes +text/html [file:///home/dockes/projets/fulltext/testrecoll/duplicates/fetchmail.html] [Fetchmail Feature List] 9184 bytes diff --git a/tests/fb2/fb2.sh b/tests/fb2/fb2.sh new file mode 100755 index 00000000..e0dc7905 --- /dev/null +++ b/tests/fb2/fb2.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +topdir=`dirname $0`/.. +. $topdir/shared.sh + +initvariables $0 + +( +recollq -S url '"the Foreign Enlistment Act, and the Alabama case"' +) 2> $mystderr | egrep -v '^Recoll query: ' > $mystdout + +diff -w ${myname}.txt $mystdout > $mydiffs 2>&1 + +checkresult diff --git a/tests/fb2/fb2.txt b/tests/fb2/fb2.txt new file mode 100644 index 00000000..f1f9fee6 --- /dev/null +++ b/tests/fb2/fb2.txt @@ -0,0 +1,2 @@ +1 results +text/x-fictionbook [file:///home/dockes/projets/fulltext/testrecoll/fb2/capKettle.fb2] [The Adventures of Captain Kettle] 2662 bytes diff --git a/tests/kword/kword.sh b/tests/kword/kword.sh new file mode 100755 index 00000000..56e41659 --- /dev/null +++ b/tests/kword/kword.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +topdir=`dirname $0`/.. +. $topdir/shared.sh + +initvariables $0 + +( +recollq -S url '"Ceci est un essai de document kword"' +recollq -S url '"Summary of the P-LILEC"' +) 2> $mystderr | egrep -v '^Recoll query: ' > $mystdout + +diff -w ${myname}.txt $mystdout > $mydiffs 2>&1 + +checkresult diff --git a/tests/kword/kword.txt b/tests/kword/kword.txt new file mode 100644 index 00000000..5548004d --- /dev/null +++ b/tests/kword/kword.txt @@ -0,0 +1,4 @@ +1 results +application/x-kword [file:///home/dockes/projets/fulltext/testrecoll/kword/essai.kwd] [Un essai avec Kword] 3951 bytes +1 results +application/x-kword [file:///home/dockes/projets/fulltext/testrecoll/kword/p-lilec1.kwd] [p-lilec1.kwd] 7075 bytes diff --git a/tests/runtests.sh b/tests/runtests.sh index e7086ae7..a8eaa898 100644 --- a/tests/runtests.sh +++ b/tests/runtests.sh @@ -1,5 +1,7 @@ #!/bin/sh +export TMPDIR=$HOME/tmp + fatal() { echo $*;exit 1 diff --git a/tests/webarchives/webarchives.sh b/tests/webarchives/webarchives.sh new file mode 100755 index 00000000..3a035900 --- /dev/null +++ b/tests/webarchives/webarchives.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +topdir=`dirname $0`/.. +. $topdir/shared.sh + +initvariables $0 + +( + recollq -S url '"Le témoignage émouvant de Loubna Abidar"' + recollq -S url '"ils ont declare que ma mere etait communiste"' + recollq -S url '"We borrow a lot of code from other packages"' dir:webarchives +) 2> $mystderr | egrep -v '^Recoll query: ' > $mystdout + +diff -w ${myname}.txt $mystdout > $mydiffs 2>&1 + +checkresult diff --git a/tests/webarchives/webarchives.txt b/tests/webarchives/webarchives.txt new file mode 100644 index 00000000..87da13d4 --- /dev/null +++ b/tests/webarchives/webarchives.txt @@ -0,0 +1,6 @@ +1 results +application/x-mimehtml [file:///home/dockes/projets/fulltext/testrecoll/webarchives/Le Figaro - Actualités.mhtml] [Le Figaro - Actualit?s] 2368156 bytes +1 results +application/x-mimehtml [file:///home/dockes/projets/fulltext/testrecoll/webarchives/01-timbl-in-liberation.mht] [« Je suis toujours inquiet pour le Web »- Ecrans] 527597 bytes +1 results +text/html [file:///home/dockes/projets/fulltext/testrecoll/webarchives/RECOLL.war] [RECOLL: a personal text search system for Unix/Linux] 7017 bytes diff --git a/tests/wordperfect/wordperfect.sh b/tests/wordperfect/wordperfect.sh new file mode 100755 index 00000000..362eda13 --- /dev/null +++ b/tests/wordperfect/wordperfect.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +topdir=`dirname $0`/.. +. $topdir/shared.sh + +initvariables $0 + +( +recollq -S url '"A review. Atmospheric Environment 14:983-1011"' +) 2> $mystderr | egrep -v '^Recoll query: ' > $mystdout + +diff -w ${myname}.txt $mystdout > $mydiffs 2>&1 + +checkresult diff --git a/tests/wordperfect/wordperfect.txt b/tests/wordperfect/wordperfect.txt new file mode 100644 index 00000000..cfef3fec --- /dev/null +++ b/tests/wordperfect/wordperfect.txt @@ -0,0 +1,2 @@ +1 results +application/vnd.wordperfect [file:///home/dockes/projets/fulltext/testrecoll/wordperfect/acenaph.wpd] [acenaph.wpd] 45346 bytes