add tests for tricky edge cases

This commit is contained in:
Ihor Andrianov
2025-01-29 03:14:53 +02:00
parent 2407a29e90
commit 0714ab64af

View File

@@ -631,3 +631,15 @@ do_execsql_test json-patch-mixed-types-1 {
'{"arr":[1,2,3],"obj":{"x":1}}'
);
} {{{"str":"hello","num":42,"bool":true,"arr":[1,2,3],"obj":{"x":1}}}}
do_execsql_test json-patch-add-all-dup-keys-from-patch {
select json_patch(
'{"x":100,"x":200}',
'{"z":{}, "z":5, "z":100}'
);
} {{{"x":100,"x":200,"z":{},"z":5,"z":100}}}
do_execsql_test json-patch-first-occurance-patch {
select json_patch(
'{"x":100,"x":200}',
'{"x":{}, "x":5, "x":100}'
);
} {{{"x":{},"x":200}}}