X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=test%2Fapi%2Ftest_search.c;h=6f30c6067caeb85797874c155283c17821709962;hb=ab5db8f3b991ecc823f92b3c8bfd22ede9b679df;hp=80e75d36ca6f9b9d974e11c4d2fdcc2c2cf6a41f;hpb=8664d6939b6be2e0de78c81ff99b8e24d304abc3;p=idzebra-moved-to-github.git
diff --git a/test/api/test_search.c b/test/api/test_search.c
index 80e75d3..6f30c60 100644
--- a/test/api/test_search.c
+++ b/test/api/test_search.c
@@ -1,5 +1,5 @@
/* This file is part of the Zebra server.
- Copyright (C) 1994-2009 Index Data
+ Copyright (C) 1994-2010 Index Data
Zebra is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
@@ -50,6 +50,7 @@ const char *myrec[] = {
"\n",
"\nMy title xa b c c c a y\n\n" ,
+ "\ntesta1 a2 c a1 a2 a3\n\n" ,
"\n"
" 2107-09-19 00:00:00\n"
@@ -173,8 +174,8 @@ 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}", 4));
- YAZ_CHECK(tl_query(zh, "@attr 1=4 @attr 2=103 {x my}", 3));
+ YAZ_CHECK(tl_query(zh, "@attr 1=_ALLRECORDS @attr 2=103 {ym}", 5));
+ YAZ_CHECK(tl_query(zh, "@attr 1=4 @attr 2=103 {x my}", 4));
YAZ_CHECK(tl_query_x(zh, "@attr 1=1 @attr 2=103 {x my}", 0, 114));
/* and searches */
@@ -246,6 +247,16 @@ static void tst(int argc, char **argv)
/* 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));
+
+ /* 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 @prox 0 1 1 2 k 2 a1 a2 a3", 1));
+ YAZ_CHECK(tl_query(zh, "@attr 1=1016 @prox 0 1 1 3 k 2 @prox 0 1 1 3 k 2 a1 a2 a3", 1));
+
/* 3 term @prox test.. */
YAZ_CHECK(tl_query(zh, "@attr 1=1016 \"a b c\"", 1));
@@ -255,7 +266,7 @@ static void tst(int argc, char **argv)
/* 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 *
+ /* 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) */