Added tests for catching the missing occurrences in rsbetween (bug #202)
authorHeikki Levanto <heikki@indexdata.dk>
Mon, 1 Nov 2004 16:09:05 +0000 (16:09 +0000)
committerHeikki Levanto <heikki@indexdata.dk>
Mon, 1 Nov 2004 16:09:05 +0000 (16:09 +0000)
test/api/xpath4.c
test/api/xpath5.c

index 993bc2a..0dcdb94 100644 (file)
@@ -1,6 +1,6 @@
 
 
-/* $Id: xpath4.c,v 1.1 2004-10-29 14:16:22 heikki Exp $
+/* $Id: xpath4.c,v 1.2 2004-11-01 16:09:05 heikki Exp $
    Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
    Index Data Aps
 
@@ -51,7 +51,7 @@ const char *myrec[] = {
  
     "<record> \n"
     "  <title>hamlet</title> \n"
-    "  <author>foo bar grunt</author> \n"
+    "  <author>foo bar grunt grunt grunt</author> \n"
     "</record> \n",
 
     0};
@@ -70,10 +70,14 @@ int main(int argc, char **argv)
     q("@attr 1=/record/title[@lang='da'] foo",1);
     q("@attr 1=/record/title[@lang='en'] foo",1);
     q("@attr 1=/record/title @and foo bar",2);
-    /* The last one returns two hits, as the and applies to the whole
+    /* The previous one returns two hits, as the and applies to the whole
     record, so it matches <title>foo</title><title>bar</title>
     This might not have to be like that, but currently that is what
     zebra does.  */
     q("@and @attr 1=/record/title foo @attr 1=/record/title bar ",2);
+
+    /* check we get all the occureences for 'grunt' */
+    /* this can only be seen in the log, with debugs on. bug #202 */
+    q("@attr 1=/record/author grunt",2);
     return close_down(zh, zs, 0);
 }
index 1262caa..b525989 100644 (file)
@@ -1,6 +1,6 @@
 
 
-/* $Id: xpath5.c,v 1.1 2004-11-01 11:45:39 heikki Exp $
+/* $Id: xpath5.c,v 1.2 2004-11-01 16:09:05 heikki Exp $
    Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
    Index Data Aps
 
@@ -77,13 +77,15 @@ int main(int argc, char **argv)
 
     q("@attr 1=/ @attr 2=102 foo",
             3,"second title",850);
+
+#if 0 
     /* FIXME - This query triggers bug #202 */
     /* http://bugs.index/show_bug.cgi?id=202 */
     /* it seems that the ranking does not see all occurrences */
     /* of 'foo', and thus ranks all records as high. */
-    /*
     q("@attr 1=/record/ @attr 2=102 foo",
             3,"second title",846);
-     Ø*/
+#endif
+
     return close_down(zh, zs, 0);
 }