{
cql_transform_t ct = cql_transform_create();
- YAZ_CHECK(compare(ct, "abc", "\"abc\""));
+ YAZ_CHECK(compare(ct, "abc", "abc"));
YAZ_CHECK(compare(ct, "\"a b c\"", "\"a b c\""));
- YAZ_CHECK(compare(ct, "@and a b", "\"a\" and \"b\""));
- YAZ_CHECK(compare(ct, "@attr 1=field abc", "field=\"abc\""));
+ YAZ_CHECK(compare(ct, "@and a b", "a and b"));
+ YAZ_CHECK(compare(ct, "@attr 1=field abc", "field=abc"));
YAZ_CHECK(compare(ct, "@attr 1=4 abc", 0)); /* should fail */
cql_transform_define_pattern(ct, "index.title", "1=4");
- YAZ_CHECK(compare(ct, "@attr 1=4 abc", "title=\"abc\""));
+ YAZ_CHECK(compare(ct, "@attr 1=4 abc", "title=abc"));
cql_transform_define_pattern(ct, "index.foo", "1=bar");
- YAZ_CHECK(compare(ct, "@attr 1=bar abc", "foo=\"abc\""));
+ YAZ_CHECK(compare(ct, "@attr 1=bar abc", "foo=abc"));
cql_transform_close(ct);
}
wrbuf_puts(w, "../etc/pqf.properties");
ct = cql_transform_open_fname(wrbuf_cstr(w));
- YAZ_CHECK(compare(ct, "@attr 1=4 abc", "dc.title=\"abc\""));
- YAZ_CHECK(compare(ct, "@attr 1=4 @attr 4=108 abc", "dc.title=/exact \"abc\""));
- YAZ_CHECK(compare(ct, "@attr 1=4 @attr 3=1 @attr 6=1 abc", "dc.title=\"abc\""));
- YAZ_CHECK(compare(ct, "@attr 1=4 @attr 4=1 @attr 6=1 abc", "dc.title=\"abc\""));
- YAZ_CHECK(compare(ct, "@attr 1=1016 abc", "\"abc\""));
+ YAZ_CHECK(compare(ct, "@attr 1=4 abc", "dc.title=abc"));
+ YAZ_CHECK(compare(ct, "@attr 1=4 @attr 4=108 abc", "dc.title=/exact abc"));
+ YAZ_CHECK(compare(ct, "@attr 1=4 @attr 3=1 @attr 6=1 abc", "dc.title=abc"));
+ YAZ_CHECK(compare(ct, "@attr 1=4 @attr 4=1 @attr 6=1 abc", "dc.title=abc"));
+ YAZ_CHECK(compare(ct, "@attr 1=1016 abc", "abc"));
/* Date tests */
- YAZ_CHECK(compare(ct, "@attr 2=1 @attr 1=30 1980", "dc.date<\"1980\""));
- YAZ_CHECK(compare(ct, "@attr 1=30 @attr 2=3 1980", "dc.date=\"1980\""));
- YAZ_CHECK(compare(ct, "@attr 1=30 @attr 2=5 1980", "dc.date>\"1980\""));
- YAZ_CHECK(compare(ct, "@attr 1=30 @attr 2=2 1980", "dc.date<=\"1980\""));
- YAZ_CHECK(compare(ct, "@attr 1=30 @attr 2=4 1980", "dc.date>=\"1980\""));
+ YAZ_CHECK(compare(ct, "@attr 2=1 @attr 1=30 1980", "dc.date<1980"));
+ YAZ_CHECK(compare(ct, "@attr 1=30 @attr 2=3 1980", "dc.date=1980"));
+ YAZ_CHECK(compare(ct, "@attr 1=30 @attr 2=5 1980", "dc.date>1980"));
+ YAZ_CHECK(compare(ct, "@attr 1=30 @attr 2=2 1980", "dc.date<=1980"));
+ YAZ_CHECK(compare(ct, "@attr 1=30 @attr 2=4 1980", "dc.date>=1980"));
/* Truncation */
- YAZ_CHECK(compare(ct, "@attr 5=1 water", "\"water*\""));
- YAZ_CHECK(compare(ct, "@attr 5=2 water", "\"*water\""));
- YAZ_CHECK(compare(ct, "@attr 5=3 water", "\"*water*\""));
- YAZ_CHECK(compare(ct, "@attr 5=100 water", "\"water\""));
- YAZ_CHECK(compare(ct, "@attr 5=102 water", "\"water\""));
- YAZ_CHECK(compare(ct, "@attr 5=104 water", "\"water\""));
-
- YAZ_CHECK(compare(ct, "@attr 5=102 wat.*er", "\"wat*er\""));
- YAZ_CHECK(compare(ct, "@attr 5=104 wat?er", "\"wat*er\""));
-
- YAZ_CHECK(compare(ct, "@attr 5=102 wat.er", "\"wat?er\""));
- YAZ_CHECK(compare(ct, "@attr 5=104 wat#er", "\"wat?er\""));
- YAZ_CHECK(compare(ct, "@attr 5=102 wat?er", "\"wat\\?er\""));
- YAZ_CHECK(compare(ct, "@attr 5=104 wat*er", "\"wat\\*er\""));
- YAZ_CHECK(compare(ct, "@attr 5=102 wat#er", "\"wat#er\""));
+ YAZ_CHECK(compare(ct, "@attr 5=1 water", "water*"));
+ YAZ_CHECK(compare(ct, "@attr 5=2 water", "*water"));
+ YAZ_CHECK(compare(ct, "@attr 5=3 water", "*water*"));
+ YAZ_CHECK(compare(ct, "@attr 5=100 water", "water"));
+ YAZ_CHECK(compare(ct, "@attr 5=102 water", "water"));
+ YAZ_CHECK(compare(ct, "@attr 5=104 water", "water"));
+
+ YAZ_CHECK(compare(ct, "@attr 5=102 wat.*er", "wat*er"));
+ YAZ_CHECK(compare(ct, "@attr 5=104 wat?er", "wat*er"));
+
+ YAZ_CHECK(compare(ct, "@attr 5=102 wat.er", "wat?er"));
+ YAZ_CHECK(compare(ct, "@attr 5=104 wat#er", "wat?er"));
+ YAZ_CHECK(compare(ct, "@attr 5=102 wat?er", "wat\\?er"));
+ YAZ_CHECK(compare(ct, "@attr 5=104 wat*er", "wat\\*er"));
+ YAZ_CHECK(compare(ct, "@attr 5=102 wat#er", "wat#er"));
/* \. is 'eaten' by PQF parser */
- YAZ_CHECK(compare(ct, "@attr 5=102 wat\\.er", "\"wat?er\""));
+ YAZ_CHECK(compare(ct, "@attr 5=102 wat\\.er", "wat?er"));
/* Escape sequences */
/* note: escape sequences that survive after PQF parse below */
- YAZ_CHECK(compare(ct, "@attr 5=102 wat\\\\?er", "\"wat\\?er\""));
- YAZ_CHECK(compare(ct, "@attr 5=104 wat\\\\?er", "\"wat\\?er\""));
+ YAZ_CHECK(compare(ct, "@attr 5=102 wat\\\\?er", "wat\\?er"));
+ YAZ_CHECK(compare(ct, "@attr 5=104 wat\\\\?er", "wat\\?er"));
- YAZ_CHECK(compare(ct, "@attr 5=102 wat\\\\*er", "\"wat\\*er\""));
- YAZ_CHECK(compare(ct, "@attr 5=104 wat\\\\*er", "\"wat\\*er\""));
+ YAZ_CHECK(compare(ct, "@attr 5=102 wat\\\\*er", "wat\\*er"));
+ YAZ_CHECK(compare(ct, "@attr 5=104 wat\\\\*er", "wat\\*er"));
- YAZ_CHECK(compare(ct, "wat\\\\#er", "\"wat#er\""));
- YAZ_CHECK(compare(ct, "@attr 5=100 wat\\\\#er", "\"wat#er\""));
- YAZ_CHECK(compare(ct, "@attr 5=102 wat\\\\#er", "\"wat#er\""));
- YAZ_CHECK(compare(ct, "@attr 5=104 wat\\\\#er", "\"wat#er\""));
- YAZ_CHECK(compare(ct, "@attr 5=102 wat\\\\.er", "\"wat.er\""));
- YAZ_CHECK(compare(ct, "@attr 5=104 wat\\\\.er", "\"wat.er\""));
+ YAZ_CHECK(compare(ct, "wat\\\\#er", "wat#er"));
+ YAZ_CHECK(compare(ct, "@attr 5=100 wat\\\\#er", "wat#er"));
+ YAZ_CHECK(compare(ct, "@attr 5=102 wat\\\\#er", "wat#er"));
+ YAZ_CHECK(compare(ct, "@attr 5=104 wat\\\\#er", "wat#er"));
+ YAZ_CHECK(compare(ct, "@attr 5=102 wat\\\\.er", "wat.er"));
+ YAZ_CHECK(compare(ct, "@attr 5=104 wat\\\\.er", "wat.er"));
/* Quoting */
YAZ_CHECK(compare(ct, "@attr 5=100 \"\"", "\"\""));
YAZ_CHECK(compare(ct, "@attr 5=3 \"water basket\"", "\"*water basket*\""));
/* Other */
- YAZ_CHECK(compare(ct, "@attr 2=103 @attr 1=_ALLRECORDS 1", "cql.allRecords=\"1\""));
+ YAZ_CHECK(compare(ct, "@attr 2=103 @attr 1=_ALLRECORDS 1", "cql.allRecords=1"));
YAZ_CHECK(compare(ct, "@attr 1=500 abc", 0));
cql_transform_close(ct);
wrbuf_destroy(w);