OLD | NEW |
1 # 2001 September 15 | 1 # 2001 September 15 |
2 # | 2 # |
3 # The author disclaims copyright to this source code. In place of | 3 # The author disclaims copyright to this source code. In place of |
4 # a legal notice, here is a blessing: | 4 # a legal notice, here is a blessing: |
5 # | 5 # |
6 # May you do good and not evil. | 6 # May you do good and not evil. |
7 # May you find forgiveness for yourself and forgive others. | 7 # May you find forgiveness for yourself and forgive others. |
8 # May you share freely, never taking more than you give. | 8 # May you share freely, never taking more than you give. |
9 # | 9 # |
10 #*********************************************************************** | 10 #*********************************************************************** |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 } | 158 } |
159 | 159 |
160 test_expr expr-1.107 {i1=0} {(1<<63)%-1} 0 | 160 test_expr expr-1.107 {i1=0} {(1<<63)%-1} 0 |
161 test_expr expr-1.108 {i1=0} {1%0} {{}} | 161 test_expr expr-1.108 {i1=0} {1%0} {{}} |
162 test_expr expr-1.109 {i1=0} {1/0} {{}} | 162 test_expr expr-1.109 {i1=0} {1/0} {{}} |
163 | 163 |
164 if {[working_64bit_int]} { | 164 if {[working_64bit_int]} { |
165 test_expr expr-1.110 {i1=0} {-9223372036854775807/-1} 9223372036854775807 | 165 test_expr expr-1.110 {i1=0} {-9223372036854775807/-1} 9223372036854775807 |
166 } | 166 } |
167 | 167 |
| 168 test_expr expr-1.111 {i1=NULL, i2=8} {i1 IS i2} 0 |
| 169 test_expr expr-1.112 {i1=NULL, i2=NULL} {i1 IS i2} 1 |
| 170 test_expr expr-1.113 {i1=6, i2=NULL} {i1 IS i2} 0 |
| 171 test_expr expr-1.114 {i1=6, i2=6} {i1 IS i2} 1 |
| 172 test_expr expr-1.115 {i1=NULL, i2=8} \ |
| 173 {CASE WHEN i1 IS i2 THEN 'yes' ELSE 'no' END} no |
| 174 test_expr expr-1.116 {i1=NULL, i2=NULL} \ |
| 175 {CASE WHEN i1 IS i2 THEN 'yes' ELSE 'no' END} yes |
| 176 test_expr expr-1.117 {i1=6, i2=NULL} \ |
| 177 {CASE WHEN i1 IS i2 THEN 'yes' ELSE 'no' END} no |
| 178 test_expr expr-1.118 {i1=8, i2=8} \ |
| 179 {CASE WHEN i1 IS i2 THEN 'yes' ELSE 'no' END} yes |
| 180 test_expr expr-1.119 {i1=NULL, i2=8} {i1 IS NOT i2} 1 |
| 181 test_expr expr-1.120 {i1=NULL, i2=NULL} {i1 IS NOT i2} 0 |
| 182 test_expr expr-1.121 {i1=6, i2=NULL} {i1 IS NOT i2} 1 |
| 183 test_expr expr-1.122 {i1=6, i2=6} {i1 IS NOT i2} 0 |
| 184 test_expr expr-1.123 {i1=NULL, i2=8} \ |
| 185 {CASE WHEN i1 IS NOT i2 THEN 'yes' ELSE 'no' END} yes |
| 186 test_expr expr-1.124 {i1=NULL, i2=NULL} \ |
| 187 {CASE WHEN i1 IS NOT i2 THEN 'yes' ELSE 'no' END} no |
| 188 test_expr expr-1.125 {i1=6, i2=NULL} \ |
| 189 {CASE WHEN i1 IS NOT i2 THEN 'yes' ELSE 'no' END} yes |
| 190 test_expr expr-1.126 {i1=8, i2=8} \ |
| 191 {CASE WHEN i1 IS NOT i2 THEN 'yes' ELSE 'no' END} no |
| 192 |
168 ifcapable floatingpoint { | 193 ifcapable floatingpoint { |
169 test_expr expr-2.1 {r1=1.23, r2=2.34} {r1+r2} 3.57 | 194 test_expr expr-2.1 {r1=1.23, r2=2.34} {r1+r2} 3.57 |
170 test_expr expr-2.2 {r1=1.23, r2=2.34} {r1-r2} -1.11 | 195 test_expr expr-2.2 {r1=1.23, r2=2.34} {r1-r2} -1.11 |
171 test_expr expr-2.3 {r1=1.23, r2=2.34} {r1*r2} 2.8782 | 196 test_expr expr-2.3 {r1=1.23, r2=2.34} {r1*r2} 2.8782 |
172 } | 197 } |
173 set tcl_precision 15 | 198 set tcl_precision 15 |
174 ifcapable floatingpoint { | 199 ifcapable floatingpoint { |
175 test_expr expr-2.4 {r1=1.23, r2=2.34} {r1/r2} 0.525641025641026 | 200 test_expr expr-2.4 {r1=1.23, r2=2.34} {r1/r2} 0.525641025641026 |
176 test_expr expr-2.5 {r1=1.23, r2=2.34} {r2/r1} 1.90243902439024 | 201 test_expr expr-2.5 {r1=1.23, r2=2.34} {r2/r1} 1.90243902439024 |
177 test_expr expr-2.6 {r1=1.23, r2=2.34} {r2<r1} 0 | 202 test_expr expr-2.6 {r1=1.23, r2=2.34} {r2<r1} 0 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 test_expr expr-4.9 {t1='0.0', t2='abc'} {t1==t2} 0 | 283 test_expr expr-4.9 {t1='0.0', t2='abc'} {t1==t2} 0 |
259 | 284 |
260 ifcapable floatingpoint { | 285 ifcapable floatingpoint { |
261 test_expr expr-4.10 {r1='0.0', r2='abc'} {r1>r2} 0 | 286 test_expr expr-4.10 {r1='0.0', r2='abc'} {r1>r2} 0 |
262 test_expr expr-4.11 {r1='abc', r2='Abc'} {r1<r2} 0 | 287 test_expr expr-4.11 {r1='abc', r2='Abc'} {r1<r2} 0 |
263 test_expr expr-4.12 {r1='abc', r2='Abc'} {r1>r2} 1 | 288 test_expr expr-4.12 {r1='abc', r2='Abc'} {r1>r2} 1 |
264 test_expr expr-4.13 {r1='abc', r2='Bbc'} {r1<r2} 0 | 289 test_expr expr-4.13 {r1='abc', r2='Bbc'} {r1<r2} 0 |
265 test_expr expr-4.14 {r1='abc', r2='Bbc'} {r1>r2} 1 | 290 test_expr expr-4.14 {r1='abc', r2='Bbc'} {r1>r2} 1 |
266 test_expr expr-4.15 {r1='0', r2='0.0'} {r1==r2} 1 | 291 test_expr expr-4.15 {r1='0', r2='0.0'} {r1==r2} 1 |
267 test_expr expr-4.16 {r1='0.000', r2='0.0'} {r1==r2} 1 | 292 test_expr expr-4.16 {r1='0.000', r2='0.0'} {r1==r2} 1 |
268 test_expr expr-4.17 {r1=' 0.000', r2=' 0.0'} {r1==r2} 0 | 293 test_expr expr-4.17 {r1=' 0.000', r2=' 0.0'} {r1==r2} 1 |
269 test_expr expr-4.18 {r1='0.0', r2='abc'} {r1<r2} 1 | 294 test_expr expr-4.18 {r1='0.0', r2='abc'} {r1<r2} 1 |
270 test_expr expr-4.19 {r1='0.0', r2='abc'} {r1==r2} 0 | 295 test_expr expr-4.19 {r1='0.0', r2='abc'} {r1==r2} 0 |
271 test_expr expr-4.20 {r1='0.0', r2='abc'} {r1>r2} 0 | 296 test_expr expr-4.20 {r1='0.0', r2='abc'} {r1>r2} 0 |
272 } | 297 } |
273 | 298 |
274 # CSL is true if LIKE is case sensitive and false if not. | 299 # CSL is true if LIKE is case sensitive and false if not. |
275 # NCSL is the opposite. Use these variables as the result | 300 # NCSL is the opposite. Use these variables as the result |
276 # on operations where case makes a difference. | 301 # on operations where case makes a difference. |
277 set CSL $sqlite_options(casesensitivelike) | 302 set CSL $sqlite_options(casesensitivelike) |
278 set NCSL [expr {!$CSL}] | 303 set NCSL [expr {!$CSL}] |
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
793 } | 818 } |
794 } {9.22337203685478e+18} | 819 } {9.22337203685478e+18} |
795 do_test expr-13.7 { | 820 do_test expr-13.7 { |
796 execsql { | 821 execsql { |
797 SELECT '9223372036854775807.0'+0 | 822 SELECT '9223372036854775807.0'+0 |
798 } | 823 } |
799 } {9.22337203685478e+18} | 824 } {9.22337203685478e+18} |
800 | 825 |
801 | 826 |
802 finish_test | 827 finish_test |
OLD | NEW |