aboutsummaryrefslogtreecommitdiff
path: root/test/json102.test
diff options
context:
space:
mode:
authordrh <>2023-04-26 17:30:28 +0000
committerdrh <>2023-04-26 17:30:28 +0000
commitf14b2e35fa2bcacdf14a3be31e7370670ebd1e34 (patch)
tree69d61023c456764285840fdbf27f3f70f21ee083 /test/json102.test
parent5255102e04d0872280dc6c776a4318e985c54abf (diff)
downloadsqlite-f14b2e35fa2bcacdf14a3be31e7370670ebd1e34.tar.gz
sqlite-f14b2e35fa2bcacdf14a3be31e7370670ebd1e34.zip
Partial implementation of JSON5 numeric literal extensions. Use a switch()
statement in the parser for better performance. FossilOrigin-Name: 78404dc37024cad5fe7eacf78ea85b56f08b129a1b9a046c3e1b11275068a485
Diffstat (limited to 'test/json102.test')
-rw-r--r--test/json102.test33
1 files changed, 21 insertions, 12 deletions
diff --git a/test/json102.test b/test/json102.test
index f551c4b82..d45ec11bf 100644
--- a/test/json102.test
+++ b/test/json102.test
@@ -301,18 +301,27 @@ for {set i 0} {$i<100} {incr i} {
# allowing them. The following tests verify that the problem is now
# fixed.
#
-do_execsql_test json102-1401 { SELECT json_valid('{"x":01}') } 0
-do_execsql_test json102-1402 { SELECT json_valid('{"x":-01}') } 0
-do_execsql_test json102-1403 { SELECT json_valid('{"x":0}') } 1
-do_execsql_test json102-1404 { SELECT json_valid('{"x":-0}') } 1
-do_execsql_test json102-1405 { SELECT json_valid('{"x":0.1}') } 1
-do_execsql_test json102-1406 { SELECT json_valid('{"x":-0.1}') } 1
-do_execsql_test json102-1407 { SELECT json_valid('{"x":0.0000}') } 1
-do_execsql_test json102-1408 { SELECT json_valid('{"x":-0.0000}') } 1
-do_execsql_test json102-1409 { SELECT json_valid('{"x":01.5}') } 0
-do_execsql_test json102-1410 { SELECT json_valid('{"x":-01.5}') } 0
-do_execsql_test json102-1411 { SELECT json_valid('{"x":00}') } 0
-do_execsql_test json102-1412 { SELECT json_valid('{"x":-00}') } 0
+foreach {id j x0 x5} {
+ 1401 {'{"x":01}'} 0 1
+ 1402 {'{"x":-01}'} 0 1
+ 1403 {'{"x":0}'} 1 1
+ 1404 {'{"x":-0}'} 1 1
+ 1405 {'{"x":0.1}'} 1 1
+ 1406 {'{"x":-0.1}'} 1 1
+ 1407 {'{"x":0.0000}'} 1 1
+ 1408 {'{"x":-0.0000}'} 1 1
+ 1409 {'{"x":01.5}'} 0 1
+ 1410 {'{"x":-01.5}'} 0 1
+ 1411 {'{"x":00}'} 0 1
+ 1412 {'{"x":-00}'} 0 1
+ 1413 {'{"x":+0}'} 0 1
+ 1414 {'{"x":+5}'} 0 1
+ 1415 {'{"x":+5.5}'} 0 1
+} {
+ do_execsql_test json102-$id "
+ SELECT json_valid($j), json_valid5($j);
+ " [list $x0 $x5]
+}
#------------------------------------------------------------------------
# 2017-04-10 ticket 6c9b5514077fed34551f98e64c09a10dc2fc8e16