mirror of
https://github.com/tursodatabase/limbo.git
synced 2025-07-07 12:35:00 +00:00
Created basic tcl tests for changes and total_changes
This commit is contained in:
parent
28ce68091f
commit
a54222d12b
3 changed files with 48 additions and 0 deletions
|
@ -20,3 +20,5 @@ source $testdir/select.test
|
|||
source $testdir/subquery.test
|
||||
source $testdir/where.test
|
||||
source $testdir/compare.test
|
||||
source $testdir/changes.test
|
||||
source $testdir/total-changes.test
|
||||
|
|
23
testing/changes.test
Normal file
23
testing/changes.test
Normal file
|
@ -0,0 +1,23 @@
|
|||
#!/usr/bin/env tclsh
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
|
||||
do_execsql_test_on_specific_db {:memory:} changes-on-basic-insert {
|
||||
create table temp (t1 integer, primary key (t1));
|
||||
insert into temp values (1);
|
||||
select changes();
|
||||
} {1}
|
||||
|
||||
do_execsql_test_on_specific_db {:memory:} changes-on-multiple-row-insert {
|
||||
create table temp (t1 integer, primary key (t1));
|
||||
insert into temp values (1), (2), (3);
|
||||
select changes();
|
||||
} {3}
|
||||
|
||||
do_execsql_test_on_specific_db {:memory:} changes-shows-most-recent {
|
||||
create table temp (t1 integer, primary key (t1));
|
||||
insert into temp values (1), (2), (3);
|
||||
insert into temp values (4), (5), (6), (7);
|
||||
select changes();
|
||||
} {4}
|
23
testing/total-changes.test
Normal file
23
testing/total-changes.test
Normal file
|
@ -0,0 +1,23 @@
|
|||
#!/usr/bin/env tclsh
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
|
||||
do_execsql_test_on_specific_db {:memory:} total-changes-on-basic-insert {
|
||||
create table temp (t1 integer, primary key (t1));
|
||||
insert into temp values (1);
|
||||
select total_changes();
|
||||
} {1}
|
||||
|
||||
do_execsql_test_on_specific_db {:memory:} total-changes-on-multiple-row-insert {
|
||||
create table temp (t1 integer, primary key (t1));
|
||||
insert into temp values (1), (2), (3);
|
||||
select total_changes();
|
||||
} {3}
|
||||
|
||||
do_execsql_test_on_specific_db {:memory:} total-changes-on-multiple-inserts {
|
||||
create table temp (t1 integer, primary key (t1));
|
||||
insert into temp values (1), (2), (3);
|
||||
insert into temp values (4), (5), (6), (7);
|
||||
select total_changes();
|
||||
} {7}
|
Loading…
Add table
Add a link
Reference in a new issue