From f4e331231be5c43340567d9e12c1920e895b04a7 Mon Sep 17 00:00:00 2001 From: Kacper Madej Date: Thu, 9 Jan 2025 17:22:19 +0700 Subject: [PATCH] More tests --- testing/json.test | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/testing/json.test b/testing/json.test index 11d4796a1..9b7e0919a 100755 --- a/testing/json.test +++ b/testing/json.test @@ -305,6 +305,30 @@ do_execsql_test json_arrow_shift_implicit_root_path_array_negative_idx { SELECT '[1,2,3]' ->> -1; } {{3}} +do_execsql_test json_arrow_implicit_real_cast { + SELECT '{"1.5":"abc"}' -> 1.5; +} {{"abc"}} + +do_execsql_test json_arrow_shift_implicit_real_cast { + SELECT '{"1.5":"abc"}' -> 1.5; +} {{abc}} + +do_execsql_test json_arrow_implicit_true_cast { + SELECT '[1,2,3]' -> true +} {{2}} + +do_execsql_test json_arrow_shift_implicit_true_cast { + SELECT '[1,2,3]' ->> true +} {{2}} + +do_execsql_test json_arrow_implicit_false_cast { + SELECT '[1,2,3]' -> false +} {{1}} + +do_execsql_test json_arrow_shift_implicit_false_cast { + SELECT '[1,2,3]' ->> false +} {{1}} + # TODO: fix me - this passes on SQLite and needs to be fixed in Limbo. do_execsql_test json_extract_multiple_null_paths { SELECT json_extract(1, null, null, null)