X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=test%2Fapi%2Ftest_search.c;h=6d568af879dcdf63db136d7c4414ac697f4a4704;hb=6a0f9234f945bc4956e2bcef75f715661a9eba9a;hp=55219f97d7fd7bc56a2c7214a5905eea2b2edcde;hpb=d46ace3ea1c666fea65433fddfc493594a7aaddc;p=idzebra-moved-to-github.git diff --git a/test/api/test_search.c b/test/api/test_search.c index 55219f9..6d568af 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) 1995-2008 Index Data + Copyright (C) 1994-2009 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 @@ -67,20 +67,31 @@ static void tst(int argc, char **argv) /* simple term */ YAZ_CHECK(tl_query(zh, "@attr 1=4 notfound", 0)); YAZ_CHECK(tl_query(zh, "@attr 1=4 title", 3)); - tl_fetch_compare(zh, 1, "zebra::facet::title:w", yaz_oid_recsyn_sutrs, - "term 3 3: my\n" - "term 3 3: title\n" - "term 2 2: x\n"); + YAZ_CHECK_EQ(tl_fetch_compare(zh, 1, "zebra::facet::title:w", + yaz_oid_recsyn_sutrs, + "facet w title\n" + "term 3 3: my\n" + "term 3 3: title\n" + "term 2 2: x\n"), ZEBRA_OK); + + YAZ_CHECK_EQ(tl_fetch_compare(zh, 1, "zebra::facet::title:s", + yaz_oid_recsyn_sutrs, + "facet s title\n" + "term 1 1: my title\n" + "term 1 1: my title x\n" + "term 1 1: my x title\n"), ZEBRA_OK); /* trunc right */ YAZ_CHECK(tl_query(zh, "@attr 1=4 @attr 5=1 titl", 3)); YAZ_CHECK(tl_query(zh, "@attr 1=4 @attr 5=1 x", 2)); - tl_fetch_compare(zh, 1, "zebra::facet::title:w", yaz_oid_recsyn_sutrs, - "term 2 2: my\n" - "term 2 2: title\n" - "term 2 2: x\n"); - + YAZ_CHECK_EQ(tl_fetch_compare(zh, 1, "zebra::facet::title:w", + yaz_oid_recsyn_sutrs, + "facet w title\n" + "term 2 2: my\n" + "term 2 2: title\n" + "term 2 2: x\n"), ZEBRA_OK); + /* trunc left */ YAZ_CHECK(tl_query(zh, "@attr 1=4 @attr 5=2 titl", 0)); YAZ_CHECK(tl_query(zh, "@attr 1=4 @attr 5=2 x", 2)); @@ -341,6 +352,7 @@ TL_MAIN /* * Local variables: * c-basic-offset: 4 + * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab