Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 08d2b93

Browse files
feodorNikita Glukhov
authored and
Nikita Glukhov
committed
improve tests
1 parent 4261dfd commit 08d2b93

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

src/test/regress/expected/jsonb_jsonpath.out

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,3 +516,39 @@ from
516516
"null" | "null" | null
517517
(9 rows)
518518

519+
select _jsonpath_exists(jsonb '{"a": 1, "b":1}', '$ ? (.a == .b)');
520+
_jsonpath_exists
521+
------------------
522+
t
523+
(1 row)
524+
525+
select _jsonpath_exists(jsonb '{"c": {"a": 1, "b":1}}', '$ ? (.a == .b)');
526+
_jsonpath_exists
527+
------------------
528+
f
529+
(1 row)
530+
531+
select _jsonpath_exists(jsonb '{"c": {"a": 1, "b":1}}', '$.c ? (.a == .b)');
532+
_jsonpath_exists
533+
------------------
534+
t
535+
(1 row)
536+
537+
select _jsonpath_exists(jsonb '{"c": {"a": 1, "b":1}}', '$.* ? (.a == .b)');
538+
_jsonpath_exists
539+
------------------
540+
t
541+
(1 row)
542+
543+
select _jsonpath_exists(jsonb '{"a": 1, "b":1}', '$.** ? (.a == .b)');
544+
_jsonpath_exists
545+
------------------
546+
t
547+
(1 row)
548+
549+
select _jsonpath_exists(jsonb '{"c": {"a": 1, "b":1}}', '$.** ? (.a == .b)');
550+
_jsonpath_exists
551+
------------------
552+
t
553+
(1 row)
554+

src/test/regress/sql/jsonb_jsonpath.sql

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,10 @@ select
109109
from
110110
(values (jsonb 'true'), ('false'), ('"null"')) x(x),
111111
(values (jsonb 'true'), ('false'), ('"null"')) y(y);
112+
113+
select _jsonpath_exists(jsonb '{"a": 1, "b":1}', '$ ? (.a == .b)');
114+
select _jsonpath_exists(jsonb '{"c": {"a": 1, "b":1}}', '$ ? (.a == .b)');
115+
select _jsonpath_exists(jsonb '{"c": {"a": 1, "b":1}}', '$.c ? (.a == .b)');
116+
select _jsonpath_exists(jsonb '{"c": {"a": 1, "b":1}}', '$.* ? (.a == .b)');
117+
select _jsonpath_exists(jsonb '{"a": 1, "b":1}', '$.** ? (.a == .b)');
118+
select _jsonpath_exists(jsonb '{"c": {"a": 1, "b":1}}', '$.** ? (.a == .b)');

0 commit comments

Comments
 (0)