From: Adam Dickmeiss Date: Fri, 18 Apr 2008 14:33:05 +0000 (+0200) Subject: Added date-range search tests. X-Git-Tag: v2.0.30~6 X-Git-Url: http://git.indexdata.com/?p=idzebra-moved-to-github.git;a=commitdiff_plain;h=d46ace3ea1c666fea65433fddfc493594a7aaddc Added date-range search tests. --- diff --git a/test/api/Makefile.am b/test/api/Makefile.am index 0564f32..4f0ce42 100644 --- a/test/api/Makefile.am +++ b/test/api/Makefile.am @@ -12,7 +12,7 @@ check_PROGRAMS = test_start_stop test_result_sets \ TESTS = $(check_PROGRAMS) EXTRA_DIST=zebra.cfg test_trunc.cfg test_private_attset.cfg \ - private_attset.att private_attset.abs \ + private_attset.att private_attset.abs test_search.abs \ test_zebra_fork.cfg \ test_icu_indexing.cfg test_icu_indexing.idx \ test_safari.cfg test_sortindex.cfg \ diff --git a/test/api/test_search.abs b/test/api/test_search.abs new file mode 100644 index 0000000..c8c5ebf --- /dev/null +++ b/test/api/test_search.abs @@ -0,0 +1,9 @@ +name my +reference WAIS-schema +attset bib1.att + +esetname B @ +esetname F @ + +xelm /test_search/title title:p,title:w +xelm /test_search/date date:d diff --git a/test/api/test_search.c b/test/api/test_search.c index 54fe529..55219f9 100644 --- a/test/api/test_search.c +++ b/test/api/test_search.c @@ -30,8 +30,9 @@ const char *myrec[] = { " -102 \n" " 49 \n" " 31 \n" - " " + " \n" "\n", + "\nMy x title\n" " second test with two coord sets\n" " \n" @@ -45,9 +46,15 @@ const char *myrec[] = { " -108 \n" " 41 \n" " 25 \n" - " " + " \n" "\n", + "\nMy title x\n\n" , + + "\n" + " 2107-09-19 00:00:00\n" + "\n" + , 0} ; static void tst(int argc, char **argv) @@ -155,7 +162,7 @@ static void tst(int argc, char **argv) YAZ_CHECK(tl_query(zh, "@attr 1=4 @attr 2=5 title", 2)); /* always-matches relation */ - YAZ_CHECK(tl_query(zh, "@attr 1=_ALLRECORDS @attr 2=103 {ym}", 3)); + YAZ_CHECK(tl_query(zh, "@attr 1=_ALLRECORDS @attr 2=103 {ym}", 4)); YAZ_CHECK(tl_query(zh, "@attr 1=4 @attr 2=103 {x my}", 3)); YAZ_CHECK(tl_query_x(zh, "@attr 1=1 @attr 2=103 {x my}", 0, 114)); @@ -313,7 +320,19 @@ static void tst(int argc, char **argv) /* N=41 and N=49 get only rec2 */ YAZ_CHECK(tl_query(zh, "@attr 2=3 @attr gils 1=2040 @attr 4=109 \"41 49\" ", 1)); + + /* = */ + YAZ_CHECK(tl_query(zh, "@attr 1=30 @attr 4=5 @attr 2=3 {2107-09-19 00:00:00}", 1)); + /* < */ + YAZ_CHECK(tl_query(zh, "@attr 1=30 @attr 4=5 @attr 2=1 {2107-09-19 00:00:00}", 0)); + /* <= */ + YAZ_CHECK(tl_query(zh, "@attr 1=30 @attr 4=5 @attr 2=2 {2107-09-19 00:00:00}", 1)); + /* >= */ + YAZ_CHECK(tl_query(zh, "@attr 1=30 @attr 4=5 @attr 2=4 {2107-09-19 00:00:00}", 1)); + /* > */ + YAZ_CHECK(tl_query(zh, "@attr 1=30 @attr 4=5 @attr 2=5 {2107-09-19 00:00:00}", 0)); + YAZ_CHECK(tl_close_down(zh, zs)); } diff --git a/test/api/zebra.cfg b/test/api/zebra.cfg index 3a1549f..187555b 100644 --- a/test/api/zebra.cfg +++ b/test/api/zebra.cfg @@ -1,4 +1,4 @@ -profilepath: ${srcdir:-.}/../../tab +profilepath: ${srcdir:-.}:${srcdir:-.}/../../tab attset: bib1.att attset: gils.att