Added test for complete-subfield search (:p).
authorAdam Dickmeiss <adam@indexdata.dk>
Fri, 7 Dec 2007 14:17:37 +0000 (14:17 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Fri, 7 Dec 2007 14:17:37 +0000 (14:17 +0000)
test/api/Makefile.am
test/api/phrases-icu.xml [new file with mode: 0644]
test/api/t17.c
test/api/t17.idx

index f933ee9..304b544 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: Makefile.am,v 1.43 2007-11-07 10:24:28 adam Exp $
+# $Id: Makefile.am,v 1.44 2007-12-07 14:17:37 adam Exp $
 
 noinst_PROGRAMS = testclient
 testclient_SOURCES = testclient.c 
@@ -9,7 +9,7 @@ check_PROGRAMS = $(simpletests) $(safaritests)
 TESTS = $(check_PROGRAMS)
 
 EXTRA_DIST=zebra.cfg zebra6.cfg zebra8.cfg zebra10.cfg zebra15.cfg safari.cfg \
-       t10.att t10.abs zebra17.cfg t17.idx words-icu.xml
+       t10.att t10.abs zebra17.cfg t17.idx words-icu.xml phrases-icu.xml
 
 noinst_LIBRARIES = libtestlib.a
 
diff --git a/test/api/phrases-icu.xml b/test/api/phrases-icu.xml
new file mode 100644 (file)
index 0000000..0fe3664
--- /dev/null
@@ -0,0 +1,7 @@
+<icu_chain locale="en">
+  <transform rule="[:Control:] Any-Remove"/>
+  <tokenize rule="s"/>
+  <transform rule="[:Punctuation:] Remove"/>
+  <display/>
+  <casemap rule="l"/>
+</icu_chain>
index 20cf3f3..0c99133 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: t17.c,v 1.7 2007-12-07 14:09:09 adam Exp $
+/* $Id: t17.c,v 1.8 2007-12-07 14:17:37 adam Exp $
    Copyright (C) 1995-2007
    Index Data ApS
 
@@ -53,6 +53,12 @@ static void tst(int argc, char **argv)
 
     /* phrase search */
     YAZ_CHECK(tl_query(zh, "@attr 1=title {my computer}", 2));
+    YAZ_CHECK(tl_query(zh, "@attr 1=title @attr 6=1 {my computer}", 2));
+    YAZ_CHECK(tl_query(zh, "@attr 1=title {computer x}", 1));
+
+    /* complete-subfield search */
+    YAZ_CHECK(tl_query(zh, "@attr 1=title @attr 6=2 {my computer}", 1));
+    YAZ_CHECK(tl_query(zh, "@attr 1=title @attr 6=2 {my}", 0));
  
     YAZ_CHECK(tl_close_down(zh, zs));
 #endif
index de511b3..16e9985 100644 (file)
@@ -1,5 +1,5 @@
 # Zebra indexes as referred to from the *.abs-files.
-#  $Id: t17.idx,v 1.4 2007-11-08 21:21:58 adam Exp $
+#  $Id: t17.idx,v 1.5 2007-12-07 14:17:37 adam Exp $
 #
 
 # Traditional word index
@@ -19,7 +19,7 @@ debug 1
 # and structure is word/phrase/word-list/free-form-text/document-text
 index p
 completeness 1
-charmap string.chr
+charmap phrases-icu.xml
 
 # Sort register
 sort s