X-Git-Url: http://git.indexdata.com/?p=idzebra-moved-to-github.git;a=blobdiff_plain;f=test%2Fapi%2Ftest_search.c;h=9fe04ecd76aeab45370532f2a620c5959cdf248a;hp=09c68b168c3578abe5987bb0ba67c8ca4290abb7;hb=fb791f9a754adf7b26695fdb1ddd0fdee9bf28f9;hpb=89d16cf15eda0e4802d18b8ad09bd3653508ebfc
diff --git a/test/api/test_search.c b/test/api/test_search.c
index 09c68b1..9fe04ec 100644
--- a/test/api/test_search.c
+++ b/test/api/test_search.c
@@ -49,7 +49,7 @@ const char *myrec[] = {
" \n"
"\n",
- "\nMy title x\n\n" ,
+ "\nMy title xa b c c c a y\n\n" ,
"\n"
" 2107-09-19 00:00:00\n"
@@ -239,6 +239,33 @@ static void tst(int argc, char **argv)
/* exl=1 distance=2 order=0 relation=3 (=), known, unit=word */
YAZ_CHECK(tl_query(zh, "@attr 1=4 @prox 1 2 1 3 k 2 my x", 1));
+
+ /* exl=0 distance=2 order=1 relation=2 (<=), known, unit=word */
+ YAZ_CHECK(tl_query(zh, "@attr 1=1016 @prox 0 2 1 2 k 2 a y", 1));
+
+ /* exl=0 distance=1 order=1 relation=3 (=), known, unit=word */
+ YAZ_CHECK(tl_query(zh, "@attr 1=1016 @prox 0 1 1 3 k 2 a b", 1));
+
+
+ /* exl=0 distance=1 order=1 relation=3 (=), known, unit=word */
+ YAZ_CHECK(tl_query(zh, "@attr 1=1016 @prox 0 1 1 3 k 2 c a", 1));
+ /* exl=0 distance=1 order=1 relation=2 (<=), known, unit=word */
+ YAZ_CHECK(tl_query(zh, "@attr 1=1016 @prox 0 1 1 2 k 2 c a", 1));
+
+ /* 3 term @prox test.. */
+ YAZ_CHECK(tl_query(zh, "@attr 1=1016 \"a b c\"", 1));
+
+ /* exl=0 distance=1 order=1 relation=2 (<=), known, unit=word */
+ /* right associative (does not work, so zero hits) */
+ YAZ_CHECK(tl_query(zh, "@attr 1=1016 @prox 0 1 1 2 k 2 a @prox 0 1 1 2 k 2 b c", 0));
+ /* left associative (works fine) */
+ YAZ_CHECK(tl_query(zh, "@attr 1=1016 @prox 0 1 1 2 k 2 @prox 0 1 1 2 k 2 a b c", 1));
+
+ /* exl=0 distance=1 order=1 relation=3 (=), known, unit=word */
+ /* right associative (does not work, so zero hits) */
+ YAZ_CHECK(tl_query(zh, "@attr 1=1016 @prox 0 1 1 3 k 2 a @prox 0 1 1 3 k 2 b c", 0));
+ /* left associative (works fine) */
+ YAZ_CHECK(tl_query(zh, "@attr 1=1016 @prox 0 1 1 3 k 2 @prox 0 1 1 3 k 2 a b c", 1));
/* Non-indexed numeric use, but specified in bib1.att (bug #1142) */
YAZ_CHECK(tl_query_x(zh, "@attr 1=1000 x", 0, 114));
@@ -352,6 +379,7 @@ TL_MAIN
/*
* Local variables:
* c-basic-offset: 4
+ * c-file-style: "Stroustrup"
* indent-tabs-mode: nil
* End:
* vim: shiftwidth=4 tabstop=8 expandtab