From 6c3e218ef89acbc3275761919ef8731615ae6d7b Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 7 Dec 2007 14:17:37 +0000 Subject: [PATCH] Added test for complete-subfield search (:p). --- test/api/Makefile.am | 4 ++-- test/api/phrases-icu.xml | 7 +++++++ test/api/t17.c | 8 +++++++- test/api/t17.idx | 4 ++-- 4 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 test/api/phrases-icu.xml diff --git a/test/api/Makefile.am b/test/api/Makefile.am index f933ee9..304b544 100644 --- a/test/api/Makefile.am +++ b/test/api/Makefile.am @@ -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 index 0000000..0fe3664 --- /dev/null +++ b/test/api/phrases-icu.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/test/api/t17.c b/test/api/t17.c index 20cf3f3..0c99133 100644 --- a/test/api/t17.c +++ b/test/api/t17.c @@ -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 diff --git a/test/api/t17.idx b/test/api/t17.idx index de511b3..16e9985 100644 --- a/test/api/t17.idx +++ b/test/api/t17.idx @@ -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 -- 1.7.10.4