X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=test%2Ftest_ccl.c;h=4cc8423a020d5e271ab5bfa9bc8baf040da5896f;hb=62b57dd7f9c0ee57788bbcfb1f81697900587027;hp=40e08c26edd9f7d9a498ec54063c660a2646d55c;hpb=77c5a4fca8b516fd39b8ba213daed17a465a6b2a;p=yaz-moved-to-github.git diff --git a/test/test_ccl.c b/test/test_ccl.c index 40e08c2..4cc8423 100644 --- a/test/test_ccl.c +++ b/test/test_ccl.c @@ -86,6 +86,7 @@ void tst1(int pass) ccl_qual_fitem(bibset, "r=o", "x"); ccl_qual_fitem(bibset, "dc.title", "title"); ccl_qual_fitem(bibset, "term dc.title", "comb"); + ccl_qual_fitem(bibset, "s=ag", "ag"); break; case 1: strcpy(tstline, "ti u=4 s=pw t=l,r"); @@ -114,6 +115,9 @@ void tst1(int pass) strcpy(tstline, "comb term dc.title # combination"); ccl_qual_line(bibset, tstline); + + strcpy(tstline, "ag s=ag"); + ccl_qual_line(bibset, tstline); break; case 2: ccl_qual_buf(bibset, "ti u=4 s=pw t=l,r\n" @@ -126,6 +130,7 @@ void tst1(int pass) "x r=o\n" "title dc.title\n" "comb term dc.title\n" + "ag s=ag\n" ); break; case 3: @@ -169,6 +174,9 @@ void tst1(int pass) " \n" " \n" " \n" + " \n" + " \n" + " \n" "\n"; doc = xmlParseMemory(xml_str, strlen(xml_str)); @@ -264,6 +272,8 @@ void tst1(int pass) YAZ_CHECK(tst_ccl_query(bibset, "date=1980", "@attr 2=3 1980 ")); + YAZ_CHECK(tst_ccl_query(bibset, "(date=1980)", + "@attr 2=3 1980 ")); YAZ_CHECK(tst_ccl_query(bibset, "date=234-1990", "@and @attr 2=4 234 @attr 2=2 1990 ")); YAZ_CHECK(tst_ccl_query(bibset, "date=234- 1990", @@ -381,6 +391,30 @@ void tst1(int pass) YAZ_CHECK(tst_ccl_query(bibset, "\"a b c \"", "@attr 4=1 @attr 1=1016 \"a b c \" ")); + YAZ_CHECK(tst_ccl_query(bibset, "ag=a", + "@attr 4=2 a ")); + + YAZ_CHECK(tst_ccl_query(bibset, "ag=a b", + "@attr 4=2 \"a b\" ")); + + YAZ_CHECK(tst_ccl_query(bibset, "ag=a b \"c d\"", + "@and @attr 4=2 \"a b\" @attr 4=1 \"c d\" ")); + + YAZ_CHECK(tst_ccl_query(bibset, "ag=a b \"c\"", + "@attr 4=2 \"a b c\" ")); + + YAZ_CHECK(tst_ccl_query(bibset, "ag=a b \"\"", + "@attr 4=2 \"a b \" ")); + + YAZ_CHECK(tst_ccl_query(bibset, "ag=a \"b c\" d", + "@and @and " + "@attr 4=2 a @attr 4=1 \"b c\" @attr 4=2 d ")); + + YAZ_CHECK(tst_ccl_query(bibset, "ag=\"a b c\"", + "@attr 4=1 \"a b c\" ")); + + YAZ_CHECK(tst_ccl_query(bibset, "ag=\"a b c\" \"d e\"", + "@and @attr 4=1 \"a b c\" @attr 4=1 \"d e\" ")); ccl_qual_rm(&bibset); }