X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=test%2Ftest_ccl.c;h=72370e38d32450694fe34d589fc46b25360bf2c6;hp=ae413eafc4a641f985809b96507e0ed5afb30b6d;hb=835fe1fa5d34428ba2803cd4a2b1a9b9aec48ab0;hpb=e1f778342e0563a5cf8e5ca34d5be264afa1340e diff --git a/test/test_ccl.c b/test/test_ccl.c index ae413ea..72370e3 100644 --- a/test/test_ccl.c +++ b/test/test_ccl.c @@ -79,7 +79,7 @@ void tst1(int pass) case 0: ccl_qual_fitem(bibset, "u=4 s=pw t=l,r", "ti"); ccl_qual_fitem(bibset, "1=1016 s=al,pw t=r", "term"); - ccl_qual_fitem(bibset, "1=/my/title", "dc.title"); + ccl_qual_fitem(bibset, "1=/my/title t=x", "dc.title"); ccl_qual_fitem(bibset, "r=r", "date"); ccl_qual_fitem(bibset, "r=o", "x"); ccl_qual_fitem(bibset, "dc.title", "title"); @@ -92,7 +92,7 @@ void tst1(int pass) strcpy(tstline, "term 1=1016 s=al,pw t=r # default term"); ccl_qual_line(bibset, tstline); - strcpy(tstline, "dc.title 1=/my/title"); + strcpy(tstline, "dc.title 1=/my/title t=x"); ccl_qual_line(bibset, tstline); strcpy(tstline, "date r=r # ordered relation"); @@ -111,7 +111,7 @@ void tst1(int pass) ccl_qual_buf(bibset, "ti u=4 s=pw t=l,r\n" "term 1=1016 s=al,pw t=r\r\n" "\n" - "dc.title 1=/my/title\n" + "dc.title 1=/my/title t=x\n" "date r=r\n" "x r=o\n" "title dc.title\n" @@ -139,6 +139,7 @@ void tst1(int pass) " \n" " \n" " \n" + " \n" " \n" " \n" " \n" @@ -250,14 +251,33 @@ void tst1(int pass) YAZ_CHECK(tst_ccl_query(bibset, "title=a", "@attr 1=/my/title a ")); + YAZ_CHECK(tst_ccl_query(bibset, "title=a?b#\"c?\"", + "@attr 5=102 @attr 1=/my/title a.*b.c\\\\? ")); + + YAZ_CHECK(tst_ccl_query(bibset, "title=\\(", + "@attr 5=102 @attr 1=/my/title \\\\( ")); + + YAZ_CHECK(tst_ccl_query(bibset, "title=.", + "@attr 5=102 @attr 1=/my/title \\\\. ")); + + YAZ_CHECK(tst_ccl_query(bibset, "title=\\.", + "@attr 5=102 @attr 1=/my/title \\\\. ")); + + YAZ_CHECK(tst_ccl_query(bibset, "title=\".\"", + "@attr 5=102 @attr 1=/my/title \\\\. ")); + YAZ_CHECK(tst_ccl_query(bibset, "comb=a", "@or @attr 4=2 @attr 1=1016 a " "@attr 1=/my/title a ")); YAZ_CHECK(tst_ccl_query(bibset, "a? b?", - /* correct */ "@and @attr 5=1 @attr 4=2 @attr 1=1016 a " "@attr 5=1 @attr 4=2 @attr 1=1016 b ")); + + YAZ_CHECK(tst_ccl_query(bibset, "\"a\"? \"b?\"", + "@and @attr 5=1 @attr 4=2 @attr 1=1016 a " + "@attr 4=2 @attr 1=1016 b? ")); + ccl_qual_rm(&bibset); }