X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=test%2Ftest_ccl.c;h=a0b76a0e4e07902bfa4aa7ef7f52a1604ef57ad5;hp=427a3a67e96e0fcab18bd3e4a96b039c2c8d5f2f;hb=f3fa080453f6e57618216f6e58d871fb06f0d1b6;hpb=6152d8cd8275e784278b6ccaf5f0fd3c240328b9 diff --git a/test/test_ccl.c b/test/test_ccl.c index 427a3a6..a0b76a0 100644 --- a/test/test_ccl.c +++ b/test/test_ccl.c @@ -1,5 +1,5 @@ /* This file is part of the YAZ toolkit. - * Copyright (C) 1995-2012 Index Data + * Copyright (C) Index Data * See the file LICENSE for details. */ #if HAVE_CONFIG_H @@ -324,22 +324,25 @@ void tst1(int pass) "@attr 5=104 a?b#c\\\\? ")); YAZ_CHECK(tst_ccl_query(bibset, "reg=\\(", - "@attr 5=102 \\\\( ")); + "( ")); YAZ_CHECK(tst_ccl_query(bibset, "z=\\(", "( ")); + YAZ_CHECK(tst_ccl_query(bibset, "z=a b#", + "@attr 5=104 \"a b#\" ")); + YAZ_CHECK(tst_ccl_query(bibset, "reg=\\\"", "\"\\\"\" ")); YAZ_CHECK(tst_ccl_query(bibset, "z=\\\"", "\"\\\"\" ")); YAZ_CHECK(tst_ccl_query(bibset, "reg=.", - "@attr 5=102 \\\\. ")); + ". ")); YAZ_CHECK(tst_ccl_query(bibset, "z=.", ". ")); YAZ_CHECK(tst_ccl_query(bibset, "reg=\".\"", - "@attr 5=102 \\\\. ")); + ". ")); YAZ_CHECK(tst_ccl_query(bibset, "z=\".\"", ". ")); @@ -349,14 +352,14 @@ void tst1(int pass) "@attr 5=104 ?\\\\? ")); YAZ_CHECK(tst_ccl_query(bibset, "reg=\"?\\?\"", - "@attr 5=102 \\\\?\\\\? ")); + "?? ")); YAZ_CHECK(tst_ccl_query(bibset, "z=\"?\\?\"", - "@attr 5=104 \\\\?\\\\? ")); + "?? ")); YAZ_CHECK(tst_ccl_query(bibset, "reg=\\\\", - "@attr 5=102 \\\\\\\\ ")); + "\\\\ ")); YAZ_CHECK(tst_ccl_query(bibset, "z=\\\\", - "@attr 5=104 \\\\\\\\ ")); + "\\\\ ")); YAZ_CHECK(tst_ccl_query(bibset, "\\\\", "@attr 4=2 @attr 1=1016 \\\\ ")); @@ -429,6 +432,12 @@ void tst2(void) ccl_qual_fitem(bibset, "u=4 s=pw t=l,r", "ti"); ccl_qual_fitem(bibset, "1=1016 s=al,pw t=z", "term"); + YAZ_CHECK(tst_ccl_query(bibset, "a?#", + "@attr 5=104 @attr 4=2 @attr 1=1016 a?# ")); + + YAZ_CHECK(tst_ccl_query(bibset, "a b?#", + "@and @attr 4=2 @attr 1=1016 a @attr 5=104 @attr 4=2 @attr 1=1016 b?# ")); + YAZ_CHECK(tst_ccl_query(bibset, "a*", "@attr 4=2 @attr 1=1016 a* ")); @@ -440,7 +449,17 @@ void tst2(void) "@attr 5=104 @attr 4=2 @attr 1=1016 a? ")); YAZ_CHECK(tst_ccl_query(bibset, "a?", - "@attr 5=104 @attr 4=2 @attr 1=1016 a\\\\? ")); + "@attr 4=2 @attr 1=1016 a? ")); + + ccl_qual_fitem(bibset, "?", "@mask"); + YAZ_CHECK(tst_ccl_query(bibset, "a?", + "@attr 5=104 @attr 4=2 @attr 1=1016 a# ")); + + + ccl_qual_fitem(bibset, "", "@mask"); + ccl_qual_fitem(bibset, "", "@truncation"); + YAZ_CHECK(tst_ccl_query(bibset, "a?#", + "@attr 4=2 @attr 1=1016 a?# ")); ccl_qual_fitem(bibset, "og", "@and"); ccl_qual_fitem(bibset, "eller", "@or");