aboutsummaryrefslogtreecommitdiff
path: root/test/json101.test
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2015-08-28 03:48:04 +0000
committerdrh <drh@noemail.net>2015-08-28 03:48:04 +0000
commitf6ec8d4f4cdd858c052f09091f2bac706ec9cde4 (patch)
tree8c5e0ae60287c707339c1068df5b94c6dadec601 /test/json101.test
parentecb5fedb3f7681fe963f74911e946414e0f65212 (diff)
downloadsqlite-f6ec8d4f4cdd858c052f09091f2bac706ec9cde4.tar.gz
sqlite-f6ec8d4f4cdd858c052f09091f2bac706ec9cde4.zip
Add the json_check() function, which returns its argument if the argument
is well-formed JSON or which throws an error otherwise. FossilOrigin-Name: 64abb65d4df11e5b3bcc4afc8e7c18e907c6080a
Diffstat (limited to 'test/json101.test')
-rw-r--r--test/json101.test7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/json101.test b/test/json101.test
index 752cd1b17..2b9cafa00 100644
--- a/test/json101.test
+++ b/test/json101.test
@@ -63,4 +63,11 @@ do_execsql_test json1-3.4 {
SELECT json_type(json_set('{"a":1,"b":2}','$$.b','{"x":3,"y":4}'),'$.b');
} {object}
+do_execsql_test json1-4.1 {
+ SELECT json_check(' [ 1, 2] ');
+} {[1,2]}
+do_catchsql_test json1-4.2 {
+ SELECT json_check(' [ 1, 2 ');
+} {1 {malformed JSON}}
+
finish_test