From 3b671302502c7d0990a4b5e308d08cfe1487a694 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=84=A0=EC=9A=B0?= Date: Sat, 7 Jun 2025 17:37:36 +0900 Subject: [PATCH] Add total_changes test --- testing/total-changes.test | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/testing/total-changes.test b/testing/total-changes.test index 488f99b79..5f155a1ab 100644 --- a/testing/total-changes.test +++ b/testing/total-changes.test @@ -21,3 +21,24 @@ do_execsql_test_on_specific_db {:memory:} total-changes-on-multiple-inserts { insert into temp values (4), (5), (6), (7); select total_changes(); } {7} + +do_execsql_test_on_specific_db {:memory:} total-changes-on-update-single-row { + create table temp (t1 integer primary key, t2 text); + insert into temp values (1, 'a'), (2, 'b'), (3, 'c'); + update temp set t2 = 'z' where t1 = 2; + select total_changes(); +} {4} + +do_execsql_test_on_specific_db {:memory:} total-changes-on-update-multiple-rows { + create table temp (t1 integer primary key, t2 text); + insert into temp values (1, 'a'), (2, 'b'), (3, 'c'); + update temp set t2 = 'x' where t1 > 1; + select total_changes(); +} {5} + +do_execsql_test_on_specific_db {:memory:} total-changes-on-update-no-match { + create table temp (t1 integer primary key, t2 text); + insert into temp values (1, 'a'), (2, 'b'); + update temp set t2 = 'y' where t1 = 99; + select total_changes(); +} {2}