]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Some simple test cases for JSONB direct remove.
authordrh <>
Wed, 15 Nov 2023 19:21:09 +0000 (19:21 +0000)
committerdrh <>
Wed, 15 Nov 2023 19:21:09 +0000 (19:21 +0000)
FossilOrigin-Name: 8cb4d2cbfc1b5f3c612d85138e66da8735d6589c7538fdf494a761c9b8104f18

manifest
manifest.uuid
test/jsonb01.test [new file with mode: 0644]

index 874a64e0cc5fe88d34b7d074ea787c15224fcd6a..a211f0b6599b9e27f54f55d507736702135c5359 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C jsonb_remove()\snow\sworks\swithout\shaving\sto\suse\sa\sJsonNode\sparse,\sassuming\nthat\sthe\sinput\sis\sJSONB.
-D 2023-11-15T18:55:03.625
+C Some\ssimple\stest\scases\sfor\sJSONB\sdirect\sremove.
+D 2023-11-15T19:21:09.380
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
 F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@@ -1329,6 +1329,7 @@ F test/json104.test 1b844a70cddcfa2e4cd81a5db0657b2e61e7f00868310f24f56a9ba01143
 F test/json105.test 11670a4387f4308ae0318cadcbd6a918ea7edcd19fbafde020720a073952675d
 F test/json501.test c419deb835b70c1a2c8532936927bcc1146730328edd2052276715bfd209724d
 F test/json502.test 98c38e3c4573841028a1381dfb81d4c3f9b105d39668167da10d055e503f6d0b
+F test/jsonb01.test 830e87e012518aa0bf4358ed794fe40cbf0743247d5ade273223064547cb1ceb
 F test/keyword1.test 37ef6bba5d2ed5b07ecdd6810571de2956599dff
 F test/kvtest.c 6e0228409ea7ca0497dad503fbd109badb5e59545d131014b6aaac68b56f484a
 F test/lastinsert.test 42e948fd6442f07d60acbd15d33fb86473e0ef63
@@ -2141,9 +2142,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
 F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
 F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P ba91408f4c044feda003ef93784ccefb619f99ab64379ced481ee8e9e890fd41 e76d48137ea823b7810dc8c3b70eb21adabdd6cfbac36050c85d1375e94be1de
-R 6ab8908817380ee469413c76bca0c832
-T +closed e76d48137ea823b7810dc8c3b70eb21adabdd6cfbac36050c85d1375e94be1de
+P 5207679e929786e577a0553d0d84dda5125456dcde80c0f3156f14f4d8c804cb
+R 76eca9722da06337c910d0b8ea9ca3cc
 U drh
-Z a599420b20eb0d182795d486baa84f09
+Z 9b402027f08ff9f924d703e81b5baa92
 # Remove this line to create a well-formed Fossil manifest.
index a1f41dd79ec06c3f731c87fba7f99aa920c919d5..1e29b18d5e0e9a3705421395346b4d63ac421023 100644 (file)
@@ -1 +1 @@
-5207679e929786e577a0553d0d84dda5125456dcde80c0f3156f14f4d8c804cb
\ No newline at end of file
+8cb4d2cbfc1b5f3c612d85138e66da8735d6589c7538fdf494a761c9b8104f18
\ No newline at end of file
diff --git a/test/jsonb01.test b/test/jsonb01.test
new file mode 100644 (file)
index 0000000..a01a96f
--- /dev/null
@@ -0,0 +1,46 @@
+# 2023-11-15
+#
+# The author disclaims copyright to this source code.  In place of
+# a legal notice, here is a blessing:
+#
+#    May you do good and not evil.
+#    May you find forgiveness for yourself and forgive others.
+#    May you share freely, never taking more than you give.
+#
+#***********************************************************************
+# Test cases for JSONB
+#
+
+set testdir [file dirname $argv0]
+source $testdir/tester.tcl
+
+do_execsql_test jsonb01-1.1 {
+  CREATE TABLE t1(x JSON BLOB);
+  INSERT INTO t1 VALUES(jsonb('{a:5,b:{x:10,y:11},c:[1,2,3,4]}'));
+}
+foreach {id path res} {
+  1 {$.a}    {{{"b":{"x":10,"y":11},"c":[1,2,3,4]}}}
+  2 {$.b}    {{{"a":5,"c":[1,2,3,4]}}}
+  3 {$.c}    {{{"a":5,"b":{"x":10,"y":11}}}}
+  4 {$.d}    {{{"a":5,"b":{"x":10,"y":11},"c":[1,2,3,4]}}}
+  5 {$.b.x}  {{{"a":5,"b":{"y":11},"c":[1,2,3,4]}}}
+  6 {$.b.y}  {{{"a":5,"b":{"x":10},"c":[1,2,3,4]}}}
+  7 {$.c[0]}  {{{"a":5,"b":{"x":10,"y":11},"c":[2,3,4]}}}
+  8 {$.c[1]}  {{{"a":5,"b":{"x":10,"y":11},"c":[1,3,4]}}}
+  9 {$.c[2]}  {{{"a":5,"b":{"x":10,"y":11},"c":[1,2,4]}}}
+ 10 {$.c[3]}  {{{"a":5,"b":{"x":10,"y":11},"c":[1,2,3]}}}
+ 11 {$.c[4]}  {{{"a":5,"b":{"x":10,"y":11},"c":[1,2,3,4]}}}
+ 12 {$.c[#]}  {{{"a":5,"b":{"x":10,"y":11},"c":[1,2,3,4]}}}
+ 13 {$.c[#-1]}  {{{"a":5,"b":{"x":10,"y":11},"c":[1,2,3]}}}
+ 14 {$.c[#-2]}  {{{"a":5,"b":{"x":10,"y":11},"c":[1,2,4]}}}
+ 15 {$.c[#-3]}  {{{"a":5,"b":{"x":10,"y":11},"c":[1,3,4]}}}
+ 16 {$.c[#-4]}  {{{"a":5,"b":{"x":10,"y":11},"c":[2,3,4]}}}
+ 17 {$.c[#-5]}  {{{"a":5,"b":{"x":10,"y":11},"c":[1,2,3,4]}}}
+ 18 {$.c[#-6]}  {{{"a":5,"b":{"x":10,"y":11},"c":[1,2,3,4]}}}
+} {
+  do_execsql_test jsonb01-1.2.$id {
+    SELECT json(jsonb_remove(x,$path)) FROM t1;
+  } $res
+}
+
+finish_test