X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=test%2Ftest_cql2ccl.c;h=c2bb9e3d17cd782ee8ab166a27d982026ee4675b;hb=b57542eb8dfd435b7c5f2c02e4b0d9a1a8431521;hp=cd1547baa7105f5a9810857b79a9dc63b9ccea35;hpb=e47569dbfbafa2ff798e0fe3ad5a32f26f3fc972;p=yaz-moved-to-github.git diff --git a/test/test_cql2ccl.c b/test/test_cql2ccl.c index cd1547b..c2bb9e3 100644 --- a/test/test_cql2ccl.c +++ b/test/test_cql2ccl.c @@ -77,8 +77,9 @@ static void tst(void) YAZ_CHECK(tst_query("a b", "\"a\" \"b\"")); YAZ_CHECK(tst_query("ab bc", "\"ab\" \"bc\"")); - YAZ_CHECK(tst_query("\\\\", "\"\\\"\"")); - YAZ_CHECK(tst_query("\\\"", "\"\\\"\"")); + YAZ_CHECK(tst_query("\\\\", "\"\\\\\"")); + YAZ_CHECK(tst_query("\\\"", "\"\\\"\"")); + YAZ_CHECK(tst_query("\\x" , "\"x\"")); YAZ_CHECK(tst_query("\\*", "\"*\"")); YAZ_CHECK(tst_query("\"\\*\"", "\"*\"")); @@ -87,10 +88,21 @@ static void tst(void) YAZ_CHECK(tst_query("title=x", "title=\"x\"")); YAZ_CHECK(tst_query("title=x or author=y", - "(title=\"x\" or author=\"y\")")); + "(title=\"x\") or (author=\"y\")")); + YAZ_CHECK(tst_query("title=x or author=y and date=z", + "((title=\"x\") or (author=\"y\")) and (date=\"z\")")); + YAZ_CHECK(tst_query("title all \"\"", "title=\"\"")); - YAZ_CHECK(tst_query("title all x", "title=x")); + YAZ_CHECK(tst_query("title all x", "title=\"x\"")); + YAZ_CHECK(tst_query("title all x y", "title=\"x\" and title=\"y\"")); + YAZ_CHECK(tst_query("title all \"x y\"", "title=\"x\" and title=\"y\"")); + + YAZ_CHECK(tst_query("title any x", "title=\"x\"")); + YAZ_CHECK(tst_query("title any x y", "title=\"x\" or title=\"y\"")); + YAZ_CHECK(tst_query("title any \"x y\"", "title=\"x\" or title=\"y\"")); + YAZ_CHECK(tst_query("dc.title=encyclopedia prox dinosaurs", + "(dc.title=\"encyclopedia\") % (\"dinosaurs\")")); } int main(int argc, char **argv)