aboutsummaryrefslogtreecommitdiff
path: root/test/expr.test
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2009-09-23 13:39:56 +0000
committerdrh <drh@noemail.net>2009-09-23 13:39:56 +0000
commit6f94702f20ddc53d455d384f0c06ceb8db314a1f (patch)
tree716b7d151c703d9031739ec213a6f9f5914b528f /test/expr.test
parenta8f0bf643e693df066bb26da38be8c898de5de45 (diff)
downloadsqlite-6f94702f20ddc53d455d384f0c06ceb8db314a1f.tar.gz
sqlite-6f94702f20ddc53d455d384f0c06ceb8db314a1f.zip
Add test cases for the IS and IS NOT operator.
FossilOrigin-Name: 101ed58cf4a1dfe53031b98cfc7ed01e86b4c7b6
Diffstat (limited to 'test/expr.test')
-rw-r--r--test/expr.test25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/expr.test b/test/expr.test
index 1d624d7b1..87ee8ed3c 100644
--- a/test/expr.test
+++ b/test/expr.test
@@ -165,6 +165,31 @@ if {[working_64bit_int]} {
test_expr expr-1.110 {i1=0} {-9223372036854775807/-1} 9223372036854775807
}
+test_expr expr-1.111 {i1=NULL, i2=8} {i1 IS i2} 0
+test_expr expr-1.112 {i1=NULL, i2=NULL} {i1 IS i2} 1
+test_expr expr-1.113 {i1=6, i2=NULL} {i1 IS i2} 0
+test_expr expr-1.114 {i1=6, i2=6} {i1 IS i2} 1
+test_expr expr-1.115 {i1=NULL, i2=8} \
+ {CASE WHEN i1 IS i2 THEN 'yes' ELSE 'no' END} no
+test_expr expr-1.116 {i1=NULL, i2=NULL} \
+ {CASE WHEN i1 IS i2 THEN 'yes' ELSE 'no' END} yes
+test_expr expr-1.117 {i1=6, i2=NULL} \
+ {CASE WHEN i1 IS i2 THEN 'yes' ELSE 'no' END} no
+test_expr expr-1.118 {i1=8, i2=8} \
+ {CASE WHEN i1 IS i2 THEN 'yes' ELSE 'no' END} yes
+test_expr expr-1.119 {i1=NULL, i2=8} {i1 IS NOT i2} 1
+test_expr expr-1.120 {i1=NULL, i2=NULL} {i1 IS NOT i2} 0
+test_expr expr-1.121 {i1=6, i2=NULL} {i1 IS NOT i2} 1
+test_expr expr-1.122 {i1=6, i2=6} {i1 IS NOT i2} 0
+test_expr expr-1.123 {i1=NULL, i2=8} \
+ {CASE WHEN i1 IS NOT i2 THEN 'yes' ELSE 'no' END} yes
+test_expr expr-1.124 {i1=NULL, i2=NULL} \
+ {CASE WHEN i1 IS NOT i2 THEN 'yes' ELSE 'no' END} no
+test_expr expr-1.125 {i1=6, i2=NULL} \
+ {CASE WHEN i1 IS NOT i2 THEN 'yes' ELSE 'no' END} yes
+test_expr expr-1.126 {i1=8, i2=8} \
+ {CASE WHEN i1 IS NOT i2 THEN 'yes' ELSE 'no' END} no
+
ifcapable floatingpoint {
test_expr expr-2.1 {r1=1.23, r2=2.34} {r1+r2} 3.57
test_expr expr-2.2 {r1=1.23, r2=2.34} {r1-r2} -1.11