Skip to content

Commit f321a73

Browse files
committed
improve tests
1 parent 35f946c commit f321a73

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

expected/jsquery.out

+24
Original file line numberDiff line numberDiff line change
@@ -793,6 +793,30 @@ select '[1,2,3]'::jsonb @@ '#($ = 2)';
793793
t
794794
(1 row)
795795

796+
select '[3,4]'::jsonb @@ '#($ > 2 & $ < 5)';
797+
?column?
798+
----------
799+
t
800+
(1 row)
801+
802+
select '[3,4]'::jsonb @@ '# > 2 & # < 5';
803+
?column?
804+
----------
805+
t
806+
(1 row)
807+
808+
select '[1,6]'::jsonb @@ '#($ > 2 & $ < 5)';
809+
?column?
810+
----------
811+
f
812+
(1 row)
813+
814+
select '[1,6]'::jsonb @@ '# > 2 & # < 5';
815+
?column?
816+
----------
817+
t
818+
(1 row)
819+
796820
select '{"a": {"b": 3, "c": "hey"}, "x": [5,6]}'::jsonb @@ '%.b=3';
797821
?column?
798822
----------

sql/jsquery.sql

+5
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,11 @@ select '[1,2,3]'::jsonb @@ '# = 2';
160160
select '[1,2,3]'::jsonb @@ '#.$ = 2';
161161
select '[1,2,3]'::jsonb @@ '#($ = 2)';
162162

163+
select '[3,4]'::jsonb @@ '#($ > 2 & $ < 5)';
164+
select '[3,4]'::jsonb @@ '# > 2 & # < 5';
165+
select '[1,6]'::jsonb @@ '#($ > 2 & $ < 5)';
166+
select '[1,6]'::jsonb @@ '# > 2 & # < 5';
167+
163168
select '{"a": {"b": 3, "c": "hey"}, "x": [5,6]}'::jsonb @@ '%.b=3';
164169
select '{"a": {"b": 3, "c": "hey"}, "x": [5,6]}'::jsonb @@ 'a.%=3';
165170
select '{"a": {"b": 3, "c": "hey"}, "x": [5,6]}'::jsonb @@ '%.%="hey"';

0 commit comments

Comments
 (0)