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 # This file implements tests for the JSON5 enhancements to the
12 # JSON SQL functions extension to the SQLite library.
15 set testdir [file dirname $argv0]
16 source $testdir/tester.tcl
17 set testprefix json502
22 CREATE TABLE t1(x JSON);
23 INSERT INTO t1(x) VALUES('{a:{b:{c:"hello",},},}');
24 SELECT fullkey FROM t1, json_tree(x);
25 } {{$} {$.a} {$.a.b} {$.a.b.c}}
30 SELECT json_error_position('{a:null,{"h":[1,[1,2,3]],"j":"abc"}:true}');
32 do_catchsql_test 2.2 {
33 SELECT json('{a:null,{"h":[1,[1,2,3]],"j":"abc"}:true}');
34 } {1 {malformed JSON}}
35 do_catchsql_test 2.3 {
36 SELECT '{a:null,{"h":[1,[1,2,3]],"j":"abc"}:true}'->'$h[#-1]';
37 } {1 {malformed JSON}}