On 4/10/17, Dominique Pellé <dominique.pe...@gmail.com> wrote:
>
> SQLite json could be added to https://github.com/nst/JSONTestSuite
> (in the parsers/ directory).
>

Thanks for the pointer.  I did not know about that project.

SQLite returns true from json_valid() for the following cases which
should allegedly be false:

  n_multidigit_number_then_00.json
  n_string_unescaped_newline.json
  n_string_unescaped_tab.json

This is the script that I ran to produce the results above:

CREATE TABLE files(name);
.mode csv
.import '| ls *.json' files

-- mal-formed JSON that json_valid shows as correct.
SELECT name FROM files
 WHERE name LIKE 'n_%'
  AND json_valid(readfile(name));

-- well-formed JSON that json_valid shows as incorrect.
SELECT name FROM files
 WHERE name LIKE 'y_%'
  AND NOT json_valid(readfile(name));

-- implementation-defined JSON does not cause crashes
SELECT name FROM files
 WHERE name LIKE 'i_%'
   AND json_valid(readfile(name)) NOT IN (0,1);

-- 
D. Richard Hipp
d...@sqlite.org
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to