Versino 5.0.21
[yaz-moved-to-github.git] / test / test_cql2ccl.c
index 06a1c61..ecb9be6 100644 (file)
@@ -1,5 +1,5 @@
 /* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2013 Index Data
+ * Copyright (C) Index Data
  * See the file LICENSE for details.
  */
 #if HAVE_CONFIG_H
@@ -110,7 +110,8 @@ static void tst(void)
     YAZ_CHECK(tst_query("\\*", "\"*\""));
     YAZ_CHECK(tst_query("\"\\*\"", "\"*\""));
 
-    YAZ_CHECK(tst_query("\"a b\"", "\"a b\""));
+    YAZ_CHECK(tst_query("a b", "\"a\" \"b\""));
+    YAZ_CHECK(tst_query("ab bc", "\"ab\" \"bc\""));
 
     YAZ_CHECK(tst_query("\\\\", "\"\\\\\""));
     YAZ_CHECK(tst_query("\\\"", "\"\\\"\""));
@@ -130,12 +131,17 @@ static void tst(void)
     YAZ_CHECK(tst_query("title all \"\"", "title=\"\""));
 
     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("title = \"x y\"", "title=\"x y\""));
+    YAZ_CHECK(tst_query("title = x y", "title=\"x\" \"y\""));
+
+    YAZ_CHECK(tst_query("title = x y z",  "title=\"x\" \"y\" \"z\""));
 
     YAZ_CHECK(tst_query("dc.title=encyclopedia prox dinosaurs",
                         "(dc.title=\"encyclopedia\") % (\"dinosaurs\")"));