aboutsummaryrefslogtreecommitdiff
path: root/test/json102.test
diff options
context:
space:
mode:
Diffstat (limited to 'test/json102.test')
-rw-r--r--test/json102.test16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/json102.test b/test/json102.test
index da9fbd1b7..f40580da4 100644
--- a/test/json102.test
+++ b/test/json102.test
@@ -278,4 +278,20 @@ do_execsql_test json102-1132 {
} {123}
} ;# end ifcapable vtab
+#-------------------------------------------------------------------------
+# Test that json_valid() correctly identifies non-ascii range
+# characters as non-whitespace.
+#
+do_execsql_test json102-1201 { SELECT json_valid(char(32) || '"xyz"') } 1
+do_execsql_test json102-1202 { SELECT json_valid(char(200) || '"xyz"') } 0
+
+# Off-by-one error in jsonAppendString()
+#
+for {set i 0} {$i<100} {incr i} {
+ set str abcdef[string repeat \" [expr {$i+50}]]uvwxyz
+ do_test json102-[format %d [expr {$i+1300}]] {
+ db eval {SELECT json_extract(json_array($::str),'$[0]')==$::str}
+ } {1}
+}
+
finish_test