From 0714ab64afd5eeb734159999f8b2e1874a159ff2 Mon Sep 17 00:00:00 2001 From: Ihor Andrianov Date: Wed, 29 Jan 2025 03:14:53 +0200 Subject: [PATCH] add tests for tricky edge cases --- testing/json.test | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/testing/json.test b/testing/json.test index d156572e0..850e0351a 100755 --- a/testing/json.test +++ b/testing/json.test @@ -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}}}