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

Add some more tests for the IS TRUE / IS FALSE operators.

FossilOrigin-Name: 9fe5bebefe909288e583226b5dc32e0465f6b2d8eda850d01820e3f1f8091ddd
This commit is contained in:
mistachkin
2018-03-23 14:56:05 +00:00
parent 8ad427f456
commit cf847d44ac
3 changed files with 28 additions and 8 deletions

View File

@ -123,4 +123,24 @@ do_catchsql_test istrue-524 {
INSERT INTO t2 VALUES(2,true,false,null,false);
} {1 {CHECK constraint failed: t2}}
foreach {tn val} [list 1 NaN 2 -NaN 3 NaN0 4 -NaN0 5 Inf 6 -Inf] {
do_execsql_test istrue-600.$tn.1 {
DROP TABLE IF EXISTS t1;
CREATE TABLE t1(x);
}
do_test istrue-600.$tn.2 {
set ::STMT [sqlite3_prepare db "INSERT INTO t1 VALUES(?)" -1 TAIL]
sqlite3_bind_double $::STMT 1 $val
sqlite3_step $::STMT
sqlite3_reset $::STMT
sqlite3_finalize $::STMT
} {SQLITE_OK}
do_execsql_test istrue-600.$tn.3 {
SELECT x IS TRUE FROM t1;
} [expr {$tn in [list 5 6] ? {1} : {0}}]
do_execsql_test istrue-600.$tn.4 {
SELECT x IS FALSE FROM t1;
} {0}
}
finish_test