@@ -40,6 +40,23 @@ SELECT results_eq($$
4040    ' Test that id gets added to cql filter when cql filter does exist' 
4141);
4242
43+ SELECT  results_eq($$
44+     SELECT  add_filters_to_cql(' {"collections":["a","b"]}' 
45+     $$,$$
46+     SELECT  ' {"filter":{"and": [{"in": [{"property": "collection"}, ["a", "b"]]}]}}' 
47+     $$,
48+     ' Test that collections gets added to cql filter when cql filter does not exist' 
49+ );
50+ 
51+ SELECT  results_eq($$
52+     SELECT  add_filters_to_cql(' {"collection":["a","b"]}' 
53+     $$,$$
54+     SELECT  ' {"collection": ["a", "b"]}' 
55+     $$,
56+     ' Test that collection are not added to cql filter' 
57+ );
58+ 
59+ 
4360SELECT  has_function(' pgstac' ' cql_and_append' ' jsonb' ' jsonb' 
4461
4562SELECT  has_function(' pgstac' ' query_to_cqlfilter' ' jsonb' 
@@ -137,6 +154,22 @@ SELECT results_eq($$
137154    ' Test lt as a filter on a numeric field with order by' 
138155);
139156
157+ SELECT  results_eq($$
158+     select  s from  search(' {"collections":["pgstac-test-collection"],"fields":{"include":["id"]}, "limit": 1}' 
159+     $$,$$
160+     select  ' {"next": "20200307aC0870130w361200", "prev": null, "type": "FeatureCollection", "context": {"limit": 1, "matched": 100, "returned": 1}, "features": [{"id": "20200307aC0870130w361200"}]}' 
161+     $$,
162+     ' Test collections search with unknow collection' 
163+ );
164+ 
165+ SELECT  results_eq($$
166+     select  s from  search(' {"collections":["something"]}' 
167+     $$,$$
168+     select  ' {"next": null, "prev": null, "type": "FeatureCollection", "context": {"limit": 10, "matched": 0, "returned": 0}, "features": []}' 
169+     $$,
170+     ' Test collections search with unknow collection' 
171+ );
172+ 
140173/*  template
141174SELECT results_eq($$ 
142175
0 commit comments