1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-01 06:27:03 +03:00

Code simplifications. New test cases.

FossilOrigin-Name: 57508518ef9d003d259ba98dcc32e5104aca26731a7161808741fe10bc0830d0
This commit is contained in:
drh
2018-02-26 21:26:27 +00:00
parent 171d16bb21
commit 43c4ac8bfe
8 changed files with 84 additions and 44 deletions

View File

@ -88,5 +88,39 @@ do_execsql_test istrue-500 {
INSERT INTO t2 DEFAULT VALUES;
SELECT * FROM t2;
} {1 1 1 0 0}
do_execsql_test istrue-510 {
DROP TABLE t2;
CREATE TABLE t2(
a INTEGER PRIMARY KEY,
b BOOLEAN DEFAULT(not true),
c BOOLEAN DEFAULT(not false)
);
INSERT INTO t2(a) VALUES(99);
SELECT * FROM t2;
} {99 0 1}
do_execsql_test istrue-520 {
DROP TABLE t2;
CREATE TABLE t2(
a INTEGER PRIMARY KEY,
b BOOLEAN CHECK(b IS TRUE),
c BOOLEAN CHECK(c IS FALSE),
d BOOLEAN CHECK(d IS NOT TRUE),
e BOOLEAN CHECK(e IS NOT FALSE)
);
INSERT INTO t2 VALUES(1,true,false,null,null);
SELECT * FROM t2;
} {1 1 0 {} {}}
do_catchsql_test istrue-521 {
INSERT INTO t2 VALUES(2,false,false,null,null);
} {1 {CHECK constraint failed: t2}}
do_catchsql_test istrue-522 {
INSERT INTO t2 VALUES(2,true,true,null,null);
} {1 {CHECK constraint failed: t2}}
do_catchsql_test istrue-523 {
INSERT INTO t2 VALUES(2,true,false,true,null);
} {1 {CHECK constraint failed: t2}}
do_catchsql_test istrue-524 {
INSERT INTO t2 VALUES(2,true,false,null,false);
} {1 {CHECK constraint failed: t2}}
finish_test