0
0
mirror of https://github.com/sqlite/sqlite.git synced 2024-11-25 00:49:41 +01:00
sqlite/ext/rbu/rbumisc.test
dan 42e84ae1ab Add tests to improve code coverage of the RBU module.
FossilOrigin-Name: ecb56b75a0e66462acdcce285b93f9fc56944c42902d886d6bada419059519a9
2019-05-08 18:49:51 +00:00

54 lines
1.4 KiB
Plaintext

# 2014 August 30
#
# The author disclaims copyright to this source code. In place of
# a legal notice, here is a blessing:
#
# May you do good and not evil.
# May you find forgiveness for yourself and forgive others.
# May you share freely, never taking more than you give.
#
#***********************************************************************
#
source [file join [file dirname [info script]] rbu_common.tcl]
set ::testprefix rbumisc
db close
sqlite3_shutdown
sqlite3_config_uri 1
reset_db
#-------------------------------------------------------------------------
# Ensure that RBU is not confused by oddly named tables in an RBU
# database.
#
do_execsql_test 1.0 {
CREATE TABLE x1(a, b, c INTEGER PRIMARY KEY);
}
do_test 1.1 {
forcedelete rbu.db
sqlite3 rbu rbu.db
rbu eval {
CREATE TABLE data_x1(a, b, c, rbu_control);
INSERT INTO data_x1 VALUES(1, 1, 1, 0);
INSERT INTO data_x1 VALUES(2, 2, 2, 0);
CREATE TABLE dat(a, b, c, rbu_control);
CREATE TABLE "data x1"(a, b, c, rbu_control);
CREATE TABLE datax1(a, b, c, rbu_control);
CREATE TABLE data_(a, b, c, rbu_control);
INSERT INTO "data x1" VALUES(3, 3, 3, 0);
INSERT INTO datax1 VALUES(3, 3, 3, 0);
INSERT INTO data_ VALUES(3, 3, 3, 0);
INSERT INTO dat VALUES(3, 3, 3, 0);
}
} {}
do_test 1.2 {
step_rbu test.db rbu.db
db eval { SELECT * FROM x1 }
} {1 1 1 2 2 2}
finish_test