Update tests in returning1.test to account for [c7896e88].
[sqlite.git] / test / json108.test
blob71f3814dce5df406d88605d286d3162b92eb91e1
1 # 2024-03-06
3 # The author disclaims copyright to this source code.  In place of
4 # a legal notice, here is a blessing:
6 #    May you do good and not evil.
7 #    May you find forgiveness for yourself and forgive others.
8 #    May you share freely, never taking more than you give.
10 #***********************************************************************
11 # Invariant tests for JSON built around the randomjson extension
14 set testdir [file dirname $argv0]
15 source $testdir/tester.tcl
16 set testprefix json108
18 # These tests require virtual table "json_tree" to run.
19 ifcapable !vtab { finish_test ; return }
21 load_static_extension db randomjson
22 db eval {
23   CREATE TEMP TABLE t1(j0,j5);
24   WITH RECURSIVE c(n) AS (VALUES(0) UNION ALL SELECT n+1 FROM c WHERE n<9)
25   INSERT INTO t1 SELECT random_json(n), random_json5(n) FROM c;
28 do_execsql_test 1.1 {
29   SELECT count(*) FROM t1 WHERE json(j0)==json(json_pretty(j0,NULL));
30 } 10
31 do_execsql_test 1.2 {
32   SELECT count(*) FROM t1 WHERE json(j0)==json(json_pretty(j0,NULL));
33 } 10
34 do_execsql_test 1.3 {
35   SELECT count(*) FROM t1 WHERE json(j0)==json(json_pretty(j0,''));
36 } 10
37 do_execsql_test 1.4 {
38   SELECT count(*) FROM t1 WHERE json(j0)==json(json_pretty(j0,char(9)));
39 } 10
40 do_execsql_test 1.5 {
41   SELECT count(*) FROM t1 WHERE json(j0)==json(json_pretty(j0,'/*hello*/'));
42 } 10
45 finish_test