From: Adam Dickmeiss Date: Mon, 10 Sep 2012 10:47:54 +0000 (+0200) Subject: CCL: add tests for CCL s=ag X-Git-Tag: v4.2.38~7 X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=commitdiff_plain;h=7e12528ec54fa937612c94a936f02872d9a6ca5c;ds=sidebyside CCL: add tests for CCL s=ag --- diff --git a/test/test_ccl.c b/test/test_ccl.c index 42ec35e..5b5d571 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,pw", "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,pw"); + 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,pw\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)); @@ -383,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); }