Files
TheRock/rocm-systems/projects/rocprofiler-systems/external/sqlite/test/json106.test
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

80 lines
2.1 KiB
Plaintext

# 2023-12-18
#
# 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.
#
#***********************************************************************
# Invariant tests for JSON built around the randomjson extension
#
set testdir [file dirname $argv0]
source $testdir/tester.tcl
set testprefix json106
# These tests require virtual table "json_tree" to run.
ifcapable !vtab { finish_test ; return }
load_static_extension db randomjson
db eval {
CREATE TEMP TABLE t1(j0,j5,p);
CREATE TEMP TABLE kv(n,key,val);
}
unset -nocomplain ii
for {set ii 1} {$ii<=5000} {incr ii} {
do_execsql_test $ii.1 {
DELETE FROM t1;
INSERT INTO t1(j0,j5) VALUES(random_json($ii),random_json5($ii));
SELECT json_valid(j0), json_valid(j5,2) FROM t1;
} {1 1}
do_execsql_test $ii.2 {
SELECT count(*)
FROM t1, json_tree(j0) AS rt
WHERE rt.type NOT IN ('object','array')
AND rt.atom IS NOT (j0 ->> rt.fullkey);
} 0
do_execsql_test $ii.3 {
SELECT count(*)
FROM t1, json_tree(j5) AS rt
WHERE rt.type NOT IN ('object','array')
AND rt.atom IS NOT (j0 ->> rt.fullkey);
} 0
do_execsql_test $ii.4 {
DELETE FROM kv;
INSERT INTO kv
SELECT rt.rowid, rt.fullkey, rt.atom
FROM t1, json_tree(j0) AS rt
WHERE rt.type NOT IN ('object','array');
}
do_execsql_test $ii.5 {
SELECT count(*)
FROM t1, kv
WHERE key NOT LIKE '%]'
AND json_remove(j5,key)->>key IS NOT NULL
} 0
do_execsql_test $ii.6 {
SELECT count(*)
FROM t1, kv
WHERE key NOT LIKE '%]'
AND json_insert(json_remove(j5,key),key,val)->>key IS NOT val
} 0
do_execsql_test $ii.7 {
UPDATE t1 SET p=json_patch(j0,j5);
SELECT count(*)
FROM t1, kv
WHERE p->>key IS NOT val
} 0
do_execsql_test $ii.8 {
SELECT j0 FROM t1 WHERE json(j0)!=json(json_pretty(j0));
} {}
do_execsql_test $ii.9 {
SELECT j5 FROM t1 WHERE json(j5)!=json(json_pretty(j5));
} {}
}
finish_test