xref: /sqlite-3.40.0/test/expr2.test (revision b0c4ef71)
1# 2019 May 20
2#
3# The author disclaims copyright to this source code.  In place of
4# a legal notice, here is a blessing:
5#
6#    May you do good and not evil.
7#    May you find forgiveness for yourself and forgive others.
8#    May you share freely, never taking more than you give.
9#
10#***********************************************************************
11# This file implements regression tests for SQLite library.  The
12# focus of this file is testing expressions.
13#
14
15set testdir [file dirname $argv0]
16source $testdir/tester.tcl
17set testprefix expr2
18
19do_execsql_test 1.0 {
20  CREATE TABLE t0(c0);
21  INSERT INTO t0(c0) VALUES ('val');
22}
23
24do_execsql_test 1.1 {
25  SELECT * FROM t0 WHERE (
26      ( (0 IS NOT FALSE) OR NOT (0 IS FALSE OR (t0.c0 = 1)) ) IS 0
27  )
28} {val}
29
30do_execsql_test 1.2.1 {
31  SELECT
32      ( (0 IS NOT FALSE) OR NOT (0 IS FALSE OR (t0.c0 = 1)) ) IS 0
33  FROM t0
34} {1}
35
36do_execsql_test 1.2.2 {
37  SELECT
38      ( (0 IS NOT FALSE) OR NOT (0 IS 0 OR (t0.c0 = 1)) ) IS 0
39  FROM t0
40} {1}
41
42do_execsql_test 1.3 {
43  SELECT ( (0 IS NOT FALSE) OR NOT (0 IS FALSE OR (t0.c0 = 1)) ) FROM t0
44} {0}
45
46do_execsql_test 1.4.1 {
47  SELECT (0 IS NOT FALSE) FROM t0
48} {0}
49do_execsql_test 1.4.2 {
50  SELECT NOT (0 IS FALSE OR (t0.c0 = 1)) FROM t0
51} {0}
52
53
54finish_test
55