/ Hex Artifact Content
Login

Artifact c8a495050dcec3f9e68538c3ef466726933302c1:


0000: 23 20 32 30 30 31 20 53 65 70 74 65 6d 62 65 72  # 2001 September
0010: 20 31 35 0a 23 0a 23 20 54 68 65 20 61 75 74 68   15.#.# The auth
0020: 6f 72 20 64 69 73 63 6c 61 69 6d 73 20 63 6f 70  or disclaims cop
0030: 79 72 69 67 68 74 20 74 6f 20 74 68 69 73 20 73  yright to this s
0040: 6f 75 72 63 65 20 63 6f 64 65 2e 20 20 49 6e 20  ource code.  In 
0050: 70 6c 61 63 65 20 6f 66 0a 23 20 61 20 6c 65 67  place of.# a leg
0060: 61 6c 20 6e 6f 74 69 63 65 2c 20 68 65 72 65 20  al notice, here 
0070: 69 73 20 61 20 62 6c 65 73 73 69 6e 67 3a 0a 23  is a blessing:.#
0080: 0a 23 20 20 20 20 4d 61 79 20 79 6f 75 20 64 6f  .#    May you do
0090: 20 67 6f 6f 64 20 61 6e 64 20 6e 6f 74 20 65 76   good and not ev
00a0: 69 6c 2e 0a 23 20 20 20 20 4d 61 79 20 79 6f 75  il..#    May you
00b0: 20 66 69 6e 64 20 66 6f 72 67 69 76 65 6e 65 73   find forgivenes
00c0: 73 20 66 6f 72 20 79 6f 75 72 73 65 6c 66 20 61  s for yourself a
00d0: 6e 64 20 66 6f 72 67 69 76 65 20 6f 74 68 65 72  nd forgive other
00e0: 73 2e 0a 23 20 20 20 20 4d 61 79 20 79 6f 75 20  s..#    May you 
00f0: 73 68 61 72 65 20 66 72 65 65 6c 79 2c 20 6e 65  share freely, ne
0100: 76 65 72 20 74 61 6b 69 6e 67 20 6d 6f 72 65 20  ver taking more 
0110: 74 68 61 6e 20 79 6f 75 20 67 69 76 65 2e 0a 23  than you give..#
0120: 0a 23 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a  .#**************
0130: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a  ****************
0140: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a  ****************
0150: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a  ****************
0160: 2a 2a 2a 2a 2a 2a 2a 2a 2a 0a 23 20 54 68 69 73  *********.# This
0170: 20 66 69 6c 65 20 69 6d 70 6c 65 6d 65 6e 74 73   file implements
0180: 20 72 65 67 72 65 73 73 69 6f 6e 20 74 65 73 74   regression test
0190: 73 20 66 6f 72 20 53 51 4c 69 74 65 20 6c 69 62  s for SQLite lib
01a0: 72 61 72 79 2e 20 20 54 68 65 0a 23 20 66 6f 63  rary.  The.# foc
01b0: 75 73 20 6f 66 20 74 68 69 73 20 66 69 6c 65 20  us of this file 
01c0: 69 73 20 74 65 73 74 69 6e 67 20 65 78 70 72 65  is testing expre
01d0: 73 73 69 6f 6e 73 2e 0a 23 0a 23 20 24 49 64 3a  ssions..#.# $Id:
01e0: 20 65 78 70 72 2e 74 65 73 74 2c 76 20 31 2e 31   expr.test,v 1.1
01f0: 38 20 32 30 30 32 2f 30 31 2f 31 35 20 31 38 3a  8 2002/01/15 18:
0200: 33 39 3a 34 35 20 64 72 68 20 45 78 70 20 24 0a  39:45 drh Exp $.
0210: 0a 73 65 74 20 74 65 73 74 64 69 72 20 5b 66 69  .set testdir [fi
0220: 6c 65 20 64 69 72 6e 61 6d 65 20 24 61 72 67 76  le dirname $argv
0230: 30 5d 0a 73 6f 75 72 63 65 20 24 74 65 73 74 64  0].source $testd
0240: 69 72 2f 74 65 73 74 65 72 2e 74 63 6c 0a 0a 23  ir/tester.tcl..#
0250: 20 43 72 65 61 74 65 20 61 20 74 61 62 6c 65 20   Create a table 
0260: 74 6f 20 77 6f 72 6b 20 77 69 74 68 2e 0a 23 0a  to work with..#.
0270: 65 78 65 63 73 71 6c 20 7b 43 52 45 41 54 45 20  execsql {CREATE 
0280: 54 41 42 4c 45 20 74 65 73 74 31 28 69 31 20 69  TABLE test1(i1 i
0290: 6e 74 2c 20 69 32 20 69 6e 74 2c 20 72 31 20 72  nt, i2 int, r1 r
02a0: 65 61 6c 2c 20 72 32 20 72 65 61 6c 2c 20 74 31  eal, r2 real, t1
02b0: 20 74 65 78 74 2c 20 74 32 20 74 65 78 74 29 7d   text, t2 text)}
02c0: 0a 65 78 65 63 73 71 6c 20 7b 49 4e 53 45 52 54  .execsql {INSERT
02d0: 20 49 4e 54 4f 20 74 65 73 74 31 20 56 41 4c 55   INTO test1 VALU
02e0: 45 53 28 31 2c 32 2c 31 2e 31 2c 32 2e 32 2c 27  ES(1,2,1.1,2.2,'
02f0: 68 65 6c 6c 6f 27 2c 27 77 6f 72 6c 64 27 29 7d  hello','world')}
0300: 0a 70 72 6f 63 20 74 65 73 74 5f 65 78 70 72 20  .proc test_expr 
0310: 7b 6e 61 6d 65 20 73 65 74 74 69 6e 67 73 20 65  {name settings e
0320: 78 70 72 20 72 65 73 75 6c 74 7d 20 7b 0a 20 20  xpr result} {.  
0330: 64 6f 5f 74 65 73 74 20 24 6e 61 6d 65 20 5b 66  do_test $name [f
0340: 6f 72 6d 61 74 20 7b 0a 20 20 20 20 65 78 65 63  ormat {.    exec
0350: 73 71 6c 20 7b 55 50 44 41 54 45 20 74 65 73 74  sql {UPDATE test
0360: 31 20 53 45 54 20 25 73 7d 0a 20 20 20 20 65 78  1 SET %s}.    ex
0370: 65 63 73 71 6c 20 7b 53 45 4c 45 43 54 20 25 73  ecsql {SELECT %s
0380: 20 46 52 4f 4d 20 74 65 73 74 31 7d 0a 20 20 7d   FROM test1}.  }
0390: 20 24 73 65 74 74 69 6e 67 73 20 24 65 78 70 72   $settings $expr
03a0: 5d 20 24 72 65 73 75 6c 74 0a 7d 0a 0a 74 65 73  ] $result.}..tes
03b0: 74 5f 65 78 70 72 20 65 78 70 72 2d 31 2e 31 20  t_expr expr-1.1 
03c0: 7b 69 31 3d 31 30 2c 20 69 32 3d 32 30 7d 20 7b  {i1=10, i2=20} {
03d0: 69 31 2b 69 32 7d 20 33 30 0a 74 65 73 74 5f 65  i1+i2} 30.test_e
03e0: 78 70 72 20 65 78 70 72 2d 31 2e 32 20 7b 69 31  xpr expr-1.2 {i1
03f0: 3d 31 30 2c 20 69 32 3d 32 30 7d 20 7b 69 31 2d  =10, i2=20} {i1-
0400: 69 32 7d 20 2d 31 30 0a 74 65 73 74 5f 65 78 70  i2} -10.test_exp
0410: 72 20 65 78 70 72 2d 31 2e 33 20 7b 69 31 3d 31  r expr-1.3 {i1=1
0420: 30 2c 20 69 32 3d 32 30 7d 20 7b 69 31 2a 69 32  0, i2=20} {i1*i2
0430: 7d 20 32 30 30 0a 74 65 73 74 5f 65 78 70 72 20  } 200.test_expr 
0440: 65 78 70 72 2d 31 2e 34 20 7b 69 31 3d 31 30 2c  expr-1.4 {i1=10,
0450: 20 69 32 3d 32 30 7d 20 7b 69 31 2f 69 32 7d 20   i2=20} {i1/i2} 
0460: 30 2e 35 0a 74 65 73 74 5f 65 78 70 72 20 65 78  0.5.test_expr ex
0470: 70 72 2d 31 2e 35 20 7b 69 31 3d 31 30 2c 20 69  pr-1.5 {i1=10, i
0480: 32 3d 32 30 7d 20 7b 69 32 2f 69 31 7d 20 32 0a  2=20} {i2/i1} 2.
0490: 74 65 73 74 5f 65 78 70 72 20 65 78 70 72 2d 31  test_expr expr-1
04a0: 2e 36 20 7b 69 31 3d 31 30 2c 20 69 32 3d 32 30  .6 {i1=10, i2=20
04b0: 7d 20 7b 69 32 3c 69 31 7d 20 30 0a 74 65 73 74  } {i2<i1} 0.test
04c0: 5f 65 78 70 72 20 65 78 70 72 2d 31 2e 37 20 7b  _expr expr-1.7 {
04d0: 69 31 3d 31 30 2c 20 69 32 3d 32 30 7d 20 7b 69  i1=10, i2=20} {i
04e0: 32 3c 3d 69 31 7d 20 30 0a 74 65 73 74 5f 65 78  2<=i1} 0.test_ex
04f0: 70 72 20 65 78 70 72 2d 31 2e 38 20 7b 69 31 3d  pr expr-1.8 {i1=
0500: 31 30 2c 20 69 32 3d 32 30 7d 20 7b 69 32 3e 69  10, i2=20} {i2>i
0510: 31 7d 20 31 0a 74 65 73 74 5f 65 78 70 72 20 65  1} 1.test_expr e
0520: 78 70 72 2d 31 2e 39 20 7b 69 31 3d 31 30 2c 20  xpr-1.9 {i1=10, 
0530: 69 32 3d 32 30 7d 20 7b 69 32 3e 3d 69 31 7d 20  i2=20} {i2>=i1} 
0540: 31 0a 74 65 73 74 5f 65 78 70 72 20 65 78 70 72  1.test_expr expr
0550: 2d 31 2e 31 30 20 7b 69 31 3d 31 30 2c 20 69 32  -1.10 {i1=10, i2
0560: 3d 32 30 7d 20 7b 69 32 21 3d 69 31 7d 20 31 0a  =20} {i2!=i1} 1.
0570: 74 65 73 74 5f 65 78 70 72 20 65 78 70 72 2d 31  test_expr expr-1
0580: 2e 31 31 20 7b 69 31 3d 31 30 2c 20 69 32 3d 32  .11 {i1=10, i2=2
0590: 30 7d 20 7b 69 32 3d 69 31 7d 20 30 0a 74 65 73  0} {i2=i1} 0.tes
05a0: 74 5f 65 78 70 72 20 65 78 70 72 2d 31 2e 31 32  t_expr expr-1.12
05b0: 20 7b 69 31 3d 31 30 2c 20 69 32 3d 32 30 7d 20   {i1=10, i2=20} 
05c0: 7b 69 32 3c 3e 69 31 7d 20 31 0a 74 65 73 74 5f  {i2<>i1} 1.test_
05d0: 65 78 70 72 20 65 78 70 72 2d 31 2e 31 33 20 7b  expr expr-1.13 {
05e0: 69 31 3d 31 30 2c 20 69 32 3d 32 30 7d 20 7b 69  i1=10, i2=20} {i
05f0: 32 3d 3d 69 31 7d 20 30 0a 74 65 73 74 5f 65 78  2==i1} 0.test_ex
0600: 70 72 20 65 78 70 72 2d 31 2e 31 34 20 7b 69 31  pr expr-1.14 {i1
0610: 3d 32 30 2c 20 69 32 3d 32 30 7d 20 7b 69 32 3c  =20, i2=20} {i2<
0620: 69 31 7d 20 30 0a 74 65 73 74 5f 65 78 70 72 20  i1} 0.test_expr 
0630: 65 78 70 72 2d 31 2e 31 35 20 7b 69 31 3d 32 30  expr-1.15 {i1=20
0640: 2c 20 69 32 3d 32 30 7d 20 7b 69 32 3c 3d 69 31  , i2=20} {i2<=i1
0650: 7d 20 31 0a 74 65 73 74 5f 65 78 70 72 20 65 78  } 1.test_expr ex
0660: 70 72 2d 31 2e 31 36 20 7b 69 31 3d 32 30 2c 20  pr-1.16 {i1=20, 
0670: 69 32 3d 32 30 7d 20 7b 69 32 3e 69 31 7d 20 30  i2=20} {i2>i1} 0
0680: 0a 74 65 73 74 5f 65 78 70 72 20 65 78 70 72 2d  .test_expr expr-
0690: 31 2e 31 37 20 7b 69 31 3d 32 30 2c 20 69 32 3d  1.17 {i1=20, i2=
06a0: 32 30 7d 20 7b 69 32 3e 3d 69 31 7d 20 31 0a 74  20} {i2>=i1} 1.t
06b0: 65 73 74 5f 65 78 70 72 20 65 78 70 72 2d 31 2e  est_expr expr-1.
06c0: 31 38 20 7b 69 31 3d 32 30 2c 20 69 32 3d 32 30  18 {i1=20, i2=20
06d0: 7d 20 7b 69 32 21 3d 69 31 7d 20 30 0a 74 65 73  } {i2!=i1} 0.tes
06e0: 74 5f 65 78 70 72 20 65 78 70 72 2d 31 2e 31 39  t_expr expr-1.19
06f0: 20 7b 69 31 3d 32 30 2c 20 69 32 3d 32 30 7d 20   {i1=20, i2=20} 
0700: 7b 69 32 3d 69 31 7d 20 31 0a 74 65 73 74 5f 65  {i2=i1} 1.test_e
0710: 78 70 72 20 65 78 70 72 2d 31 2e 32 30 20 7b 69  xpr expr-1.20 {i
0720: 31 3d 32 30 2c 20 69 32 3d 32 30 7d 20 7b 69 32  1=20, i2=20} {i2
0730: 3c 3e 69 31 7d 20 30 0a 74 65 73 74 5f 65 78 70  <>i1} 0.test_exp
0740: 72 20 65 78 70 72 2d 31 2e 32 31 20 7b 69 31 3d  r expr-1.21 {i1=
0750: 32 30 2c 20 69 32 3d 32 30 7d 20 7b 69 32 3d 3d  20, i2=20} {i2==
0760: 69 31 7d 20 31 0a 74 65 73 74 5f 65 78 70 72 20  i1} 1.test_expr 
0770: 65 78 70 72 2d 31 2e 32 32 20 7b 69 31 3d 31 2c  expr-1.22 {i1=1,
0780: 20 69 32 3d 32 2c 20 72 31 3d 33 2e 30 7d 20 7b   i2=2, r1=3.0} {
0790: 69 31 2b 69 32 2a 72 31 7d 20 7b 37 7d 0a 74 65  i1+i2*r1} {7}.te
07a0: 73 74 5f 65 78 70 72 20 65 78 70 72 2d 31 2e 32  st_expr expr-1.2
07b0: 33 20 7b 69 31 3d 31 2c 20 69 32 3d 32 2c 20 72  3 {i1=1, i2=2, r
07c0: 31 3d 33 2e 30 7d 20 7b 28 69 31 2b 69 32 29 2a  1=3.0} {(i1+i2)*
07d0: 72 31 7d 20 7b 39 7d 0a 74 65 73 74 5f 65 78 70  r1} {9}.test_exp
07e0: 72 20 65 78 70 72 2d 31 2e 32 34 20 7b 69 31 3d  r expr-1.24 {i1=
07f0: 31 2c 20 69 32 3d 32 7d 20 7b 6d 69 6e 28 69 31  1, i2=2} {min(i1
0800: 2c 69 32 2c 69 31 2b 69 32 2c 69 31 2d 69 32 29  ,i2,i1+i2,i1-i2)
0810: 7d 20 7b 2d 31 7d 0a 74 65 73 74 5f 65 78 70 72  } {-1}.test_expr
0820: 20 65 78 70 72 2d 31 2e 32 35 20 7b 69 31 3d 31   expr-1.25 {i1=1
0830: 2c 20 69 32 3d 32 7d 20 7b 6d 61 78 28 69 31 2c  , i2=2} {max(i1,
0840: 69 32 2c 69 31 2b 69 32 2c 69 31 2d 69 32 29 7d  i2,i1+i2,i1-i2)}
0850: 20 7b 33 7d 0a 74 65 73 74 5f 65 78 70 72 20 65   {3}.test_expr e
0860: 78 70 72 2d 31 2e 32 36 20 7b 69 31 3d 31 2c 20  xpr-1.26 {i1=1, 
0870: 69 32 3d 32 7d 20 7b 6d 61 78 28 69 31 2c 69 32  i2=2} {max(i1,i2
0880: 2c 69 31 2b 69 32 2c 69 31 2d 69 32 29 7d 20 7b  ,i1+i2,i1-i2)} {
0890: 33 7d 0a 74 65 73 74 5f 65 78 70 72 20 65 78 70  3}.test_expr exp
08a0: 72 2d 31 2e 32 37 20 7b 69 31 3d 31 2c 20 69 32  r-1.27 {i1=1, i2
08b0: 3d 32 7d 20 7b 69 31 3d 3d 31 20 41 4e 44 20 69  =2} {i1==1 AND i
08c0: 32 3d 32 7d 20 7b 31 7d 0a 74 65 73 74 5f 65 78  2=2} {1}.test_ex
08d0: 70 72 20 65 78 70 72 2d 31 2e 32 38 20 7b 69 31  pr expr-1.28 {i1
08e0: 3d 31 2c 20 69 32 3d 32 7d 20 7b 69 31 3d 32 20  =1, i2=2} {i1=2 
08f0: 41 4e 44 20 69 32 3d 31 7d 20 7b 30 7d 0a 74 65  AND i2=1} {0}.te
0900: 73 74 5f 65 78 70 72 20 65 78 70 72 2d 31 2e 32  st_expr expr-1.2
0910: 39 20 7b 69 31 3d 31 2c 20 69 32 3d 32 7d 20 7b  9 {i1=1, i2=2} {
0920: 69 31 3d 31 20 41 4e 44 20 69 32 3d 31 7d 20 7b  i1=1 AND i2=1} {
0930: 30 7d 0a 74 65 73 74 5f 65 78 70 72 20 65 78 70  0}.test_expr exp
0940: 72 2d 31 2e 33 30 20 7b 69 31 3d 31 2c 20 69 32  r-1.30 {i1=1, i2
0950: 3d 32 7d 20 7b 69 31 3d 32 20 41 4e 44 20 69 32  =2} {i1=2 AND i2
0960: 3d 32 7d 20 7b 30 7d 0a 74 65 73 74 5f 65 78 70  =2} {0}.test_exp
0970: 72 20 65 78 70 72 2d 31 2e 33 31 20 7b 69 31 3d  r expr-1.31 {i1=
0980: 31 2c 20 69 32 3d 32 7d 20 7b 69 31 3d 3d 31 20  1, i2=2} {i1==1 
0990: 4f 52 20 69 32 3d 32 7d 20 7b 31 7d 0a 74 65 73  OR i2=2} {1}.tes
09a0: 74 5f 65 78 70 72 20 65 78 70 72 2d 31 2e 33 32  t_expr expr-1.32
09b0: 20 7b 69 31 3d 31 2c 20 69 32 3d 32 7d 20 7b 69   {i1=1, i2=2} {i
09c0: 31 3d 32 20 4f 52 20 69 32 3d 31 7d 20 7b 30 7d  1=2 OR i2=1} {0}
09d0: 0a 74 65 73 74 5f 65 78 70 72 20 65 78 70 72 2d  .test_expr expr-
09e0: 31 2e 33 33 20 7b 69 31 3d 31 2c 20 69 32 3d 32  1.33 {i1=1, i2=2
09f0: 7d 20 7b 69 31 3d 31 20 4f 52 20 69 32 3d 31 7d  } {i1=1 OR i2=1}
0a00: 20 7b 31 7d 0a 74 65 73 74 5f 65 78 70 72 20 65   {1}.test_expr e
0a10: 78 70 72 2d 31 2e 33 34 20 7b 69 31 3d 31 2c 20  xpr-1.34 {i1=1, 
0a20: 69 32 3d 32 7d 20 7b 69 31 3d 32 20 4f 52 20 69  i2=2} {i1=2 OR i
0a30: 32 3d 32 7d 20 7b 31 7d 0a 74 65 73 74 5f 65 78  2=2} {1}.test_ex
0a40: 70 72 20 65 78 70 72 2d 31 2e 33 35 20 7b 69 31  pr expr-1.35 {i1
0a50: 3d 31 2c 20 69 32 3d 32 7d 20 7b 69 31 2d 69 32  =1, i2=2} {i1-i2
0a60: 3d 2d 31 7d 20 7b 31 7d 0a 74 65 73 74 5f 65 78  =-1} {1}.test_ex
0a70: 70 72 20 65 78 70 72 2d 31 2e 33 36 20 7b 69 31  pr expr-1.36 {i1
0a80: 3d 31 2c 20 69 32 3d 30 7d 20 7b 6e 6f 74 20 69  =1, i2=0} {not i
0a90: 31 7d 20 7b 30 7d 0a 74 65 73 74 5f 65 78 70 72  1} {0}.test_expr
0aa0: 20 65 78 70 72 2d 31 2e 33 37 20 7b 69 31 3d 31   expr-1.37 {i1=1
0ab0: 2c 20 69 32 3d 4e 55 4c 4c 7d 20 7b 6e 6f 74 20  , i2=NULL} {not 
0ac0: 69 32 7d 20 7b 31 7d 0a 74 65 73 74 5f 65 78 70  i2} {1}.test_exp
0ad0: 72 20 65 78 70 72 2d 31 2e 33 38 20 7b 69 31 3d  r expr-1.38 {i1=
0ae0: 31 7d 20 7b 2d 69 31 7d 20 7b 2d 31 7d 0a 74 65  1} {-i1} {-1}.te
0af0: 73 74 5f 65 78 70 72 20 65 78 70 72 2d 31 2e 33  st_expr expr-1.3
0b00: 39 20 7b 69 31 3d 31 7d 20 7b 2b 69 31 7d 20 7b  9 {i1=1} {+i1} {
0b10: 31 7d 0a 74 65 73 74 5f 65 78 70 72 20 65 78 70  1}.test_expr exp
0b20: 72 2d 31 2e 34 30 20 7b 69 31 3d 31 2c 20 69 32  r-1.40 {i1=1, i2
0b30: 3d 32 7d 20 7b 2b 28 69 32 2b 69 31 29 7d 20 7b  =2} {+(i2+i1)} {
0b40: 33 7d 0a 74 65 73 74 5f 65 78 70 72 20 65 78 70  3}.test_expr exp
0b50: 72 2d 31 2e 34 31 20 7b 69 31 3d 31 2c 20 69 32  r-1.41 {i1=1, i2
0b60: 3d 32 7d 20 7b 2d 28 69 32 2b 69 31 29 7d 20 7b  =2} {-(i2+i1)} {
0b70: 2d 33 7d 0a 74 65 73 74 5f 65 78 70 72 20 65 78  -3}.test_expr ex
0b80: 70 72 2d 31 2e 34 32 20 7b 69 31 3d 31 2c 20 69  pr-1.42 {i1=1, i
0b90: 32 3d 32 7d 20 7b 69 31 7c 69 32 7d 20 7b 33 7d  2=2} {i1|i2} {3}
0ba0: 0a 74 65 73 74 5f 65 78 70 72 20 65 78 70 72 2d  .test_expr expr-
0bb0: 31 2e 34 33 20 7b 69 31 3d 31 2c 20 69 32 3d 32  1.43 {i1=1, i2=2
0bc0: 7d 20 7b 69 31 26 69 32 7d 20 7b 30 7d 0a 74 65  } {i1&i2} {0}.te
0bd0: 73 74 5f 65 78 70 72 20 65 78 70 72 2d 31 2e 34  st_expr expr-1.4
0be0: 34 20 7b 69 31 3d 31 7d 20 7b 7e 69 31 7d 20 7b  4 {i1=1} {~i1} {
0bf0: 2d 32 7d 0a 74 65 73 74 5f 65 78 70 72 20 65 78  -2}.test_expr ex
0c00: 70 72 2d 31 2e 34 35 20 7b 69 31 3d 31 2c 20 69  pr-1.45 {i1=1, i
0c10: 32 3d 33 7d 20 7b 69 31 3c 3c 69 32 7d 20 7b 38  2=3} {i1<<i2} {8
0c20: 7d 0a 74 65 73 74 5f 65 78 70 72 20 65 78 70 72  }.test_expr expr
0c30: 2d 31 2e 34 36 20 7b 69 31 3d 33 32 2c 20 69 32  -1.46 {i1=32, i2
0c40: 3d 33 7d 20 7b 69 31 3e 3e 69 32 7d 20 7b 34 7d  =3} {i1>>i2} {4}
0c50: 0a 74 65 73 74 5f 65 78 70 72 20 65 78 70 72 2d  .test_expr expr-
0c60: 31 2e 34 37 20 7b 69 31 3d 39 39 39 39 39 39 39  1.47 {i1=9999999
0c70: 39 39 39 2c 20 69 32 3d 38 38 38 38 38 38 38 38  999, i2=88888888
0c80: 38 38 7d 20 7b 69 31 3c 69 32 7d 20 30 0a 74 65  88} {i1<i2} 0.te
0c90: 73 74 5f 65 78 70 72 20 65 78 70 72 2d 31 2e 34  st_expr expr-1.4
0ca0: 38 20 7b 69 31 3d 39 39 39 39 39 39 39 39 39 39  8 {i1=9999999999
0cb0: 2c 20 69 32 3d 38 38 38 38 38 38 38 38 38 38 7d  , i2=8888888888}
0cc0: 20 7b 69 31 3d 69 32 7d 20 30 0a 74 65 73 74 5f   {i1=i2} 0.test_
0cd0: 65 78 70 72 20 65 78 70 72 2d 31 2e 34 39 20 7b  expr expr-1.49 {
0ce0: 69 31 3d 39 39 39 39 39 39 39 39 39 39 2c 20 69  i1=9999999999, i
0cf0: 32 3d 38 38 38 38 38 38 38 38 38 38 7d 20 7b 69  2=8888888888} {i
0d00: 31 3e 69 32 7d 20 31 0a 74 65 73 74 5f 65 78 70  1>i2} 1.test_exp
0d10: 72 20 65 78 70 72 2d 31 2e 35 30 20 7b 69 31 3d  r expr-1.50 {i1=
0d20: 39 39 39 39 39 39 39 39 39 39 39 2c 20 69 32 3d  99999999999, i2=
0d30: 39 39 39 39 39 39 39 39 39 39 38 7d 20 7b 69 31  99999999998} {i1
0d40: 3c 69 32 7d 20 30 0a 74 65 73 74 5f 65 78 70 72  <i2} 0.test_expr
0d50: 20 65 78 70 72 2d 31 2e 35 31 20 7b 69 31 3d 39   expr-1.51 {i1=9
0d60: 39 39 39 39 39 39 39 39 39 39 2c 20 69 32 3d 39  9999999999, i2=9
0d70: 39 39 39 39 39 39 39 39 39 38 7d 20 7b 69 31 3d  9999999998} {i1=
0d80: 69 32 7d 20 30 0a 74 65 73 74 5f 65 78 70 72 20  i2} 0.test_expr 
0d90: 65 78 70 72 2d 31 2e 35 32 20 7b 69 31 3d 39 39  expr-1.52 {i1=99
0da0: 39 39 39 39 39 39 39 39 39 2c 20 69 32 3d 39 39  999999999, i2=99
0db0: 39 39 39 39 39 39 39 39 38 7d 20 7b 69 31 3e 69  999999998} {i1>i
0dc0: 32 7d 20 31 0a 74 65 73 74 5f 65 78 70 72 20 65  2} 1.test_expr e
0dd0: 78 70 72 2d 31 2e 35 33 20 7b 69 31 3d 30 39 39  xpr-1.53 {i1=099
0de0: 39 39 39 39 39 39 39 39 39 2c 20 69 32 3d 39 39  999999999, i2=99
0df0: 39 39 39 39 39 39 39 39 39 7d 20 7b 69 31 3c 69  999999999} {i1<i
0e00: 32 7d 20 30 0a 74 65 73 74 5f 65 78 70 72 20 65  2} 0.test_expr e
0e10: 78 70 72 2d 31 2e 35 34 20 7b 69 31 3d 30 39 39  xpr-1.54 {i1=099
0e20: 39 39 39 39 39 39 39 39 39 2c 20 69 32 3d 39 39  999999999, i2=99
0e30: 39 39 39 39 39 39 39 39 39 7d 20 7b 69 31 3d 69  999999999} {i1=i
0e40: 32 7d 20 31 0a 74 65 73 74 5f 65 78 70 72 20 65  2} 1.test_expr e
0e50: 78 70 72 2d 31 2e 35 35 20 7b 69 31 3d 30 39 39  xpr-1.55 {i1=099
0e60: 39 39 39 39 39 39 39 39 39 2c 20 69 32 3d 39 39  999999999, i2=99
0e70: 39 39 39 39 39 39 39 39 39 7d 20 7b 69 31 3e 69  999999999} {i1>i
0e80: 32 7d 20 30 0a 74 65 73 74 5f 65 78 70 72 20 65  2} 0.test_expr e
0e90: 78 70 72 2d 31 2e 35 36 20 7b 69 31 3d 32 35 2c  xpr-1.56 {i1=25,
0ea0: 20 69 32 3d 31 31 7d 20 7b 69 31 25 69 32 7d 20   i2=11} {i1%i2} 
0eb0: 33 0a 0a 74 65 73 74 5f 65 78 70 72 20 65 78 70  3..test_expr exp
0ec0: 72 2d 32 2e 31 20 7b 72 31 3d 31 2e 32 33 2c 20  r-2.1 {r1=1.23, 
0ed0: 72 32 3d 32 2e 33 34 7d 20 7b 72 31 2b 72 32 7d  r2=2.34} {r1+r2}
0ee0: 20 33 2e 35 37 0a 74 65 73 74 5f 65 78 70 72 20   3.57.test_expr 
0ef0: 65 78 70 72 2d 32 2e 32 20 7b 72 31 3d 31 2e 32  expr-2.2 {r1=1.2
0f00: 33 2c 20 72 32 3d 32 2e 33 34 7d 20 7b 72 31 2d  3, r2=2.34} {r1-
0f10: 72 32 7d 20 2d 31 2e 31 31 0a 74 65 73 74 5f 65  r2} -1.11.test_e
0f20: 78 70 72 20 65 78 70 72 2d 32 2e 33 20 7b 72 31  xpr expr-2.3 {r1
0f30: 3d 31 2e 32 33 2c 20 72 32 3d 32 2e 33 34 7d 20  =1.23, r2=2.34} 
0f40: 7b 72 31 2a 72 32 7d 20 32 2e 38 37 38 32 0a 74  {r1*r2} 2.8782.t
0f50: 65 73 74 5f 65 78 70 72 20 65 78 70 72 2d 32 2e  est_expr expr-2.
0f60: 34 20 7b 72 31 3d 31 2e 32 33 2c 20 72 32 3d 32  4 {r1=1.23, r2=2
0f70: 2e 33 34 7d 20 7b 72 31 2f 72 32 7d 20 30 2e 35  .34} {r1/r2} 0.5
0f80: 32 35 36 34 31 30 32 35 36 34 31 30 32 36 0a 74  25641025641026.t
0f90: 65 73 74 5f 65 78 70 72 20 65 78 70 72 2d 32 2e  est_expr expr-2.
0fa0: 35 20 7b 72 31 3d 31 2e 32 33 2c 20 72 32 3d 32  5 {r1=1.23, r2=2
0fb0: 2e 33 34 7d 20 7b 72 32 2f 72 31 7d 20 31 2e 39  .34} {r2/r1} 1.9
0fc0: 30 32 34 33 39 30 32 34 33 39 30 32 34 0a 74 65  0243902439024.te
0fd0: 73 74 5f 65 78 70 72 20 65 78 70 72 2d 32 2e 36  st_expr expr-2.6
0fe0: 20 7b 72 31 3d 31 2e 32 33 2c 20 72 32 3d 32 2e   {r1=1.23, r2=2.
0ff0: 33 34 7d 20 7b 72 32 3c 72 31 7d 20 30 0a 74 65  34} {r2<r1} 0.te
1000: 73 74 5f 65 78 70 72 20 65 78 70 72 2d 32 2e 37  st_expr expr-2.7
1010: 20 7b 72 31 3d 31 2e 32 33 2c 20 72 32 3d 32 2e   {r1=1.23, r2=2.
1020: 33 34 7d 20 7b 72 32 3c 3d 72 31 7d 20 30 0a 74  34} {r2<=r1} 0.t
1030: 65 73 74 5f 65 78 70 72 20 65 78 70 72 2d 32 2e  est_expr expr-2.
1040: 38 20 7b 72 31 3d 31 2e 32 33 2c 20 72 32 3d 32  8 {r1=1.23, r2=2
1050: 2e 33 34 7d 20 7b 72 32 3e 72 31 7d 20 31 0a 74  .34} {r2>r1} 1.t
1060: 65 73 74 5f 65 78 70 72 20 65 78 70 72 2d 32 2e  est_expr expr-2.
1070: 39 20 7b 72 31 3d 31 2e 32 33 2c 20 72 32 3d 32  9 {r1=1.23, r2=2
1080: 2e 33 34 7d 20 7b 72 32 3e 3d 72 31 7d 20 31 0a  .34} {r2>=r1} 1.
1090: 74 65 73 74 5f 65 78 70 72 20 65 78 70 72 2d 32  test_expr expr-2
10a0: 2e 31 30 20 7b 72 31 3d 31 2e 32 33 2c 20 72 32  .10 {r1=1.23, r2
10b0: 3d 32 2e 33 34 7d 20 7b 72 32 21 3d 72 31 7d 20  =2.34} {r2!=r1} 
10c0: 31 0a 74 65 73 74 5f 65 78 70 72 20 65 78 70 72  1.test_expr expr
10d0: 2d 32 2e 31 31 20 7b 72 31 3d 31 2e 32 33 2c 20  -2.11 {r1=1.23, 
10e0: 72 32 3d 32 2e 33 34 7d 20 7b 72 32 3d 72 31 7d  r2=2.34} {r2=r1}
10f0: 20 30 0a 74 65 73 74 5f 65 78 70 72 20 65 78 70   0.test_expr exp
1100: 72 2d 32 2e 31 32 20 7b 72 31 3d 31 2e 32 33 2c  r-2.12 {r1=1.23,
1110: 20 72 32 3d 32 2e 33 34 7d 20 7b 72 32 3c 3e 72   r2=2.34} {r2<>r
1120: 31 7d 20 31 0a 74 65 73 74 5f 65 78 70 72 20 65  1} 1.test_expr e
1130: 78 70 72 2d 32 2e 31 33 20 7b 72 31 3d 31 2e 32  xpr-2.13 {r1=1.2
1140: 33 2c 20 72 32 3d 32 2e 33 34 7d 20 7b 72 32 3d  3, r2=2.34} {r2=
1150: 3d 72 31 7d 20 30 0a 74 65 73 74 5f 65 78 70 72  =r1} 0.test_expr
1160: 20 65 78 70 72 2d 32 2e 31 34 20 7b 72 31 3d 32   expr-2.14 {r1=2
1170: 2e 33 34 2c 20 72 32 3d 32 2e 33 34 7d 20 7b 72  .34, r2=2.34} {r
1180: 32 3c 72 31 7d 20 30 0a 74 65 73 74 5f 65 78 70  2<r1} 0.test_exp
1190: 72 20 65 78 70 72 2d 32 2e 31 35 20 7b 72 31 3d  r expr-2.15 {r1=
11a0: 32 2e 33 34 2c 20 72 32 3d 32 2e 33 34 7d 20 7b  2.34, r2=2.34} {
11b0: 72 32 3c 3d 72 31 7d 20 31 0a 74 65 73 74 5f 65  r2<=r1} 1.test_e
11c0: 78 70 72 20 65 78 70 72 2d 32 2e 31 36 20 7b 72  xpr expr-2.16 {r
11d0: 31 3d 32 2e 33 34 2c 20 72 32 3d 32 2e 33 34 7d  1=2.34, r2=2.34}
11e0: 20 7b 72 32 3e 72 31 7d 20 30 0a 74 65 73 74 5f   {r2>r1} 0.test_
11f0: 65 78 70 72 20 65 78 70 72 2d 32 2e 31 37 20 7b  expr expr-2.17 {
1200: 72 31 3d 32 2e 33 34 2c 20 72 32 3d 32 2e 33 34  r1=2.34, r2=2.34
1210: 7d 20 7b 72 32 3e 3d 72 31 7d 20 31 0a 74 65 73  } {r2>=r1} 1.tes
1220: 74 5f 65 78 70 72 20 65 78 70 72 2d 32 2e 31 38  t_expr expr-2.18
1230: 20 7b 72 31 3d 32 2e 33 34 2c 20 72 32 3d 32 2e   {r1=2.34, r2=2.
1240: 33 34 7d 20 7b 72 32 21 3d 72 31 7d 20 30 0a 74  34} {r2!=r1} 0.t
1250: 65 73 74 5f 65 78 70 72 20 65 78 70 72 2d 32 2e  est_expr expr-2.
1260: 31 39 20 7b 72 31 3d 32 2e 33 34 2c 20 72 32 3d  19 {r1=2.34, r2=
1270: 32 2e 33 34 7d 20 7b 72 32 3d 72 31 7d 20 31 0a  2.34} {r2=r1} 1.
1280: 74 65 73 74 5f 65 78 70 72 20 65 78 70 72 2d 32  test_expr expr-2
1290: 2e 32 30 20 7b 72 31 3d 32 2e 33 34 2c 20 72 32  .20 {r1=2.34, r2
12a0: 3d 32 2e 33 34 7d 20 7b 72 32 3c 3e 72 31 7d 20  =2.34} {r2<>r1} 
12b0: 30 0a 74 65 73 74 5f 65 78 70 72 20 65 78 70 72  0.test_expr expr
12c0: 2d 32 2e 32 31 20 7b 72 31 3d 32 2e 33 34 2c 20  -2.21 {r1=2.34, 
12d0: 72 32 3d 32 2e 33 34 7d 20 7b 72 32 3d 3d 72 31  r2=2.34} {r2==r1
12e0: 7d 20 31 0a 74 65 73 74 5f 65 78 70 72 20 65 78  } 1.test_expr ex
12f0: 70 72 2d 32 2e 32 32 20 7b 72 31 3d 31 2e 32 33  pr-2.22 {r1=1.23
1300: 2c 20 72 32 3d 32 2e 33 34 7d 20 7b 6d 69 6e 28  , r2=2.34} {min(
1310: 72 31 2c 72 32 2c 72 31 2b 72 32 2c 72 31 2d 72  r1,r2,r1+r2,r1-r
1320: 32 29 7d 20 7b 2d 31 2e 31 31 7d 0a 74 65 73 74  2)} {-1.11}.test
1330: 5f 65 78 70 72 20 65 78 70 72 2d 32 2e 32 33 20  _expr expr-2.23 
1340: 7b 72 31 3d 31 2e 32 33 2c 20 72 32 3d 32 2e 33  {r1=1.23, r2=2.3
1350: 34 7d 20 7b 6d 61 78 28 72 31 2c 72 32 2c 72 31  4} {max(r1,r2,r1
1360: 2b 72 32 2c 72 31 2d 72 32 29 7d 20 7b 33 2e 35  +r2,r1-r2)} {3.5
1370: 37 7d 0a 74 65 73 74 5f 65 78 70 72 20 65 78 70  7}.test_expr exp
1380: 72 2d 32 2e 32 34 20 7b 72 31 3d 32 35 2e 30 2c  r-2.24 {r1=25.0,
1390: 20 72 32 3d 31 31 2e 30 7d 20 7b 72 31 25 72 32   r2=11.0} {r1%r2
13a0: 7d 20 33 0a 0a 74 65 73 74 5f 65 78 70 72 20 65  } 3..test_expr e
13b0: 78 70 72 2d 33 2e 31 20 7b 74 31 3d 27 61 62 63  xpr-3.1 {t1='abc
13c0: 27 2c 20 74 32 3d 27 78 79 7a 27 7d 20 7b 74 31  ', t2='xyz'} {t1
13d0: 3c 74 32 7d 20 31 0a 74 65 73 74 5f 65 78 70 72  <t2} 1.test_expr
13e0: 20 65 78 70 72 2d 33 2e 32 20 7b 74 31 3d 27 78   expr-3.2 {t1='x
13f0: 79 7a 27 2c 20 74 32 3d 27 61 62 63 27 7d 20 7b  yz', t2='abc'} {
1400: 74 31 3c 74 32 7d 20 30 0a 74 65 73 74 5f 65 78  t1<t2} 0.test_ex
1410: 70 72 20 65 78 70 72 2d 33 2e 33 20 7b 74 31 3d  pr expr-3.3 {t1=
1420: 27 61 62 63 27 2c 20 74 32 3d 27 61 62 63 27 7d  'abc', t2='abc'}
1430: 20 7b 74 31 3c 74 32 7d 20 30 0a 74 65 73 74 5f   {t1<t2} 0.test_
1440: 65 78 70 72 20 65 78 70 72 2d 33 2e 34 20 7b 74  expr expr-3.4 {t
1450: 31 3d 27 61 62 63 27 2c 20 74 32 3d 27 78 79 7a  1='abc', t2='xyz
1460: 27 7d 20 7b 74 31 3c 3d 74 32 7d 20 31 0a 74 65  '} {t1<=t2} 1.te
1470: 73 74 5f 65 78 70 72 20 65 78 70 72 2d 33 2e 35  st_expr expr-3.5
1480: 20 7b 74 31 3d 27 78 79 7a 27 2c 20 74 32 3d 27   {t1='xyz', t2='
1490: 61 62 63 27 7d 20 7b 74 31 3c 3d 74 32 7d 20 30  abc'} {t1<=t2} 0
14a0: 0a 74 65 73 74 5f 65 78 70 72 20 65 78 70 72 2d  .test_expr expr-
14b0: 33 2e 36 20 7b 74 31 3d 27 61 62 63 27 2c 20 74  3.6 {t1='abc', t
14c0: 32 3d 27 61 62 63 27 7d 20 7b 74 31 3c 3d 74 32  2='abc'} {t1<=t2
14d0: 7d 20 31 0a 74 65 73 74 5f 65 78 70 72 20 65 78  } 1.test_expr ex
14e0: 70 72 2d 33 2e 37 20 7b 74 31 3d 27 61 62 63 27  pr-3.7 {t1='abc'
14f0: 2c 20 74 32 3d 27 78 79 7a 27 7d 20 7b 74 31 3e  , t2='xyz'} {t1>
1500: 74 32 7d 20 30 0a 74 65 73 74 5f 65 78 70 72 20  t2} 0.test_expr 
1510: 65 78 70 72 2d 33 2e 38 20 7b 74 31 3d 27 78 79  expr-3.8 {t1='xy
1520: 7a 27 2c 20 74 32 3d 27 61 62 63 27 7d 20 7b 74  z', t2='abc'} {t
1530: 31 3e 74 32 7d 20 31 0a 74 65 73 74 5f 65 78 70  1>t2} 1.test_exp
1540: 72 20 65 78 70 72 2d 33 2e 39 20 7b 74 31 3d 27  r expr-3.9 {t1='
1550: 61 62 63 27 2c 20 74 32 3d 27 61 62 63 27 7d 20  abc', t2='abc'} 
1560: 7b 74 31 3e 74 32 7d 20 30 0a 74 65 73 74 5f 65  {t1>t2} 0.test_e
1570: 78 70 72 20 65 78 70 72 2d 33 2e 31 30 20 7b 74  xpr expr-3.10 {t
1580: 31 3d 27 61 62 63 27 2c 20 74 32 3d 27 78 79 7a  1='abc', t2='xyz
1590: 27 7d 20 7b 74 31 3e 3d 74 32 7d 20 30 0a 74 65  '} {t1>=t2} 0.te
15a0: 73 74 5f 65 78 70 72 20 65 78 70 72 2d 33 2e 31  st_expr expr-3.1
15b0: 31 20 7b 74 31 3d 27 78 79 7a 27 2c 20 74 32 3d  1 {t1='xyz', t2=
15c0: 27 61 62 63 27 7d 20 7b 74 31 3e 3d 74 32 7d 20  'abc'} {t1>=t2} 
15d0: 31 0a 74 65 73 74 5f 65 78 70 72 20 65 78 70 72  1.test_expr expr
15e0: 2d 33 2e 31 32 20 7b 74 31 3d 27 61 62 63 27 2c  -3.12 {t1='abc',
15f0: 20 74 32 3d 27 61 62 63 27 7d 20 7b 74 31 3e 3d   t2='abc'} {t1>=
1600: 74 32 7d 20 31 0a 74 65 73 74 5f 65 78 70 72 20  t2} 1.test_expr 
1610: 65 78 70 72 2d 33 2e 31 33 20 7b 74 31 3d 27 61  expr-3.13 {t1='a
1620: 62 63 27 2c 20 74 32 3d 27 78 79 7a 27 7d 20 7b  bc', t2='xyz'} {
1630: 74 31 3d 74 32 7d 20 30 0a 74 65 73 74 5f 65 78  t1=t2} 0.test_ex
1640: 70 72 20 65 78 70 72 2d 33 2e 31 34 20 7b 74 31  pr expr-3.14 {t1
1650: 3d 27 78 79 7a 27 2c 20 74 32 3d 27 61 62 63 27  ='xyz', t2='abc'
1660: 7d 20 7b 74 31 3d 74 32 7d 20 30 0a 74 65 73 74  } {t1=t2} 0.test
1670: 5f 65 78 70 72 20 65 78 70 72 2d 33 2e 31 35 20  _expr expr-3.15 
1680: 7b 74 31 3d 27 61 62 63 27 2c 20 74 32 3d 27 61  {t1='abc', t2='a
1690: 62 63 27 7d 20 7b 74 31 3d 74 32 7d 20 31 0a 74  bc'} {t1=t2} 1.t
16a0: 65 73 74 5f 65 78 70 72 20 65 78 70 72 2d 33 2e  est_expr expr-3.
16b0: 31 36 20 7b 74 31 3d 27 61 62 63 27 2c 20 74 32  16 {t1='abc', t2
16c0: 3d 27 78 79 7a 27 7d 20 7b 74 31 3d 3d 74 32 7d  ='xyz'} {t1==t2}
16d0: 20 30 0a 74 65 73 74 5f 65 78 70 72 20 65 78 70   0.test_expr exp
16e0: 72 2d 33 2e 31 37 20 7b 74 31 3d 27 78 79 7a 27  r-3.17 {t1='xyz'
16f0: 2c 20 74 32 3d 27 61 62 63 27 7d 20 7b 74 31 3d  , t2='abc'} {t1=
1700: 3d 74 32 7d 20 30 0a 74 65 73 74 5f 65 78 70 72  =t2} 0.test_expr
1710: 20 65 78 70 72 2d 33 2e 31 38 20 7b 74 31 3d 27   expr-3.18 {t1='
1720: 61 62 63 27 2c 20 74 32 3d 27 61 62 63 27 7d 20  abc', t2='abc'} 
1730: 7b 74 31 3d 3d 74 32 7d 20 31 0a 74 65 73 74 5f  {t1==t2} 1.test_
1740: 65 78 70 72 20 65 78 70 72 2d 33 2e 31 39 20 7b  expr expr-3.19 {
1750: 74 31 3d 27 61 62 63 27 2c 20 74 32 3d 27 78 79  t1='abc', t2='xy
1760: 7a 27 7d 20 7b 74 31 3c 3e 74 32 7d 20 31 0a 74  z'} {t1<>t2} 1.t
1770: 65 73 74 5f 65 78 70 72 20 65 78 70 72 2d 33 2e  est_expr expr-3.
1780: 32 30 20 7b 74 31 3d 27 78 79 7a 27 2c 20 74 32  20 {t1='xyz', t2
1790: 3d 27 61 62 63 27 7d 20 7b 74 31 3c 3e 74 32 7d  ='abc'} {t1<>t2}
17a0: 20 31 0a 74 65 73 74 5f 65 78 70 72 20 65 78 70   1.test_expr exp
17b0: 72 2d 33 2e 32 31 20 7b 74 31 3d 27 61 62 63 27  r-3.21 {t1='abc'
17c0: 2c 20 74 32 3d 27 61 62 63 27 7d 20 7b 74 31 3c  , t2='abc'} {t1<
17d0: 3e 74 32 7d 20 30 0a 74 65 73 74 5f 65 78 70 72  >t2} 0.test_expr
17e0: 20 65 78 70 72 2d 33 2e 32 32 20 7b 74 31 3d 27   expr-3.22 {t1='
17f0: 61 62 63 27 2c 20 74 32 3d 27 78 79 7a 27 7d 20  abc', t2='xyz'} 
1800: 7b 74 31 21 3d 74 32 7d 20 31 0a 74 65 73 74 5f  {t1!=t2} 1.test_
1810: 65 78 70 72 20 65 78 70 72 2d 33 2e 32 33 20 7b  expr expr-3.23 {
1820: 74 31 3d 27 78 79 7a 27 2c 20 74 32 3d 27 61 62  t1='xyz', t2='ab
1830: 63 27 7d 20 7b 74 31 21 3d 74 32 7d 20 31 0a 74  c'} {t1!=t2} 1.t
1840: 65 73 74 5f 65 78 70 72 20 65 78 70 72 2d 33 2e  est_expr expr-3.
1850: 32 34 20 7b 74 31 3d 27 61 62 63 27 2c 20 74 32  24 {t1='abc', t2
1860: 3d 27 61 62 63 27 7d 20 7b 74 31 21 3d 74 32 7d  ='abc'} {t1!=t2}
1870: 20 30 0a 74 65 73 74 5f 65 78 70 72 20 65 78 70   0.test_expr exp
1880: 72 2d 33 2e 32 35 20 7b 74 31 3d 4e 55 4c 4c 2c  r-3.25 {t1=NULL,
1890: 20 74 32 3d 27 68 69 27 7d 20 7b 74 31 20 69 73   t2='hi'} {t1 is
18a0: 6e 75 6c 6c 7d 20 31 0a 74 65 73 74 5f 65 78 70  null} 1.test_exp
18b0: 72 20 65 78 70 72 2d 33 2e 32 35 62 20 7b 74 31  r expr-3.25b {t1
18c0: 3d 4e 55 4c 4c 2c 20 74 32 3d 27 68 69 27 7d 20  =NULL, t2='hi'} 
18d0: 7b 74 31 20 69 73 20 6e 75 6c 6c 7d 20 31 0a 74  {t1 is null} 1.t
18e0: 65 73 74 5f 65 78 70 72 20 65 78 70 72 2d 33 2e  est_expr expr-3.
18f0: 32 36 20 7b 74 31 3d 4e 55 4c 4c 2c 20 74 32 3d  26 {t1=NULL, t2=
1900: 27 68 69 27 7d 20 7b 74 32 20 69 73 6e 75 6c 6c  'hi'} {t2 isnull
1910: 7d 20 30 0a 74 65 73 74 5f 65 78 70 72 20 65 78  } 0.test_expr ex
1920: 70 72 2d 33 2e 32 37 20 7b 74 31 3d 4e 55 4c 4c  pr-3.27 {t1=NULL
1930: 2c 20 74 32 3d 27 68 69 27 7d 20 7b 74 31 20 6e  , t2='hi'} {t1 n
1940: 6f 74 6e 75 6c 6c 7d 20 30 0a 74 65 73 74 5f 65  otnull} 0.test_e
1950: 78 70 72 20 65 78 70 72 2d 33 2e 32 38 20 7b 74  xpr expr-3.28 {t
1960: 31 3d 4e 55 4c 4c 2c 20 74 32 3d 27 68 69 27 7d  1=NULL, t2='hi'}
1970: 20 7b 74 32 20 6e 6f 74 6e 75 6c 6c 7d 20 31 0a   {t2 notnull} 1.
1980: 74 65 73 74 5f 65 78 70 72 20 65 78 70 72 2d 33  test_expr expr-3
1990: 2e 32 38 62 20 7b 74 31 3d 4e 55 4c 4c 2c 20 74  .28b {t1=NULL, t
19a0: 32 3d 27 68 69 27 7d 20 7b 74 32 20 69 73 20 6e  2='hi'} {t2 is n
19b0: 6f 74 20 6e 75 6c 6c 7d 20 31 0a 74 65 73 74 5f  ot null} 1.test_
19c0: 65 78 70 72 20 65 78 70 72 2d 33 2e 32 39 20 7b  expr expr-3.29 {
19d0: 74 31 3d 27 78 79 7a 27 2c 20 74 32 3d 27 61 62  t1='xyz', t2='ab
19e0: 63 27 7d 20 7b 74 31 7c 7c 74 32 7d 20 7b 78 79  c'} {t1||t2} {xy
19f0: 7a 61 62 63 7d 0a 74 65 73 74 5f 65 78 70 72 20  zabc}.test_expr 
1a00: 65 78 70 72 2d 33 2e 33 30 20 7b 74 31 3d 4e 55  expr-3.30 {t1=NU
1a10: 4c 4c 2c 20 74 32 3d 27 61 62 63 27 7d 20 7b 74  LL, t2='abc'} {t
1a20: 31 7c 7c 74 32 7d 20 7b 61 62 63 7d 0a 74 65 73  1||t2} {abc}.tes
1a30: 74 5f 65 78 70 72 20 65 78 70 72 2d 33 2e 33 31  t_expr expr-3.31
1a40: 20 7b 74 31 3d 27 78 79 7a 27 2c 20 74 32 3d 4e   {t1='xyz', t2=N
1a50: 55 4c 4c 7d 20 7b 74 31 7c 7c 74 32 7d 20 7b 78  ULL} {t1||t2} {x
1a60: 79 7a 7d 0a 74 65 73 74 5f 65 78 70 72 20 65 78  yz}.test_expr ex
1a70: 70 72 2d 33 2e 33 32 20 7b 74 31 3d 27 78 79 7a  pr-3.32 {t1='xyz
1a80: 27 2c 20 74 32 3d 27 61 62 63 27 7d 20 7b 74 31  ', t2='abc'} {t1
1a90: 7c 7c 27 20 68 69 20 27 7c 7c 74 32 7d 20 7b 7b  ||' hi '||t2} {{
1aa0: 78 79 7a 20 68 69 20 61 62 63 7d 7d 0a 0a 74 65  xyz hi abc}}..te
1ab0: 73 74 5f 65 78 70 72 20 65 78 70 72 2d 34 2e 31  st_expr expr-4.1
1ac0: 20 7b 74 31 3d 27 61 62 63 27 2c 20 74 32 3d 27   {t1='abc', t2='
1ad0: 41 62 63 27 7d 20 7b 74 31 3c 74 32 7d 20 30 0a  Abc'} {t1<t2} 0.
1ae0: 74 65 73 74 5f 65 78 70 72 20 65 78 70 72 2d 34  test_expr expr-4
1af0: 2e 32 20 7b 74 31 3d 27 61 62 63 27 2c 20 74 32  .2 {t1='abc', t2
1b00: 3d 27 41 62 63 27 7d 20 7b 74 31 3e 74 32 7d 20  ='Abc'} {t1>t2} 
1b10: 31 0a 74 65 73 74 5f 65 78 70 72 20 65 78 70 72  1.test_expr expr
1b20: 2d 34 2e 33 20 7b 74 31 3d 27 61 62 63 27 2c 20  -4.3 {t1='abc', 
1b30: 74 32 3d 27 42 62 63 27 7d 20 7b 74 31 3c 74 32  t2='Bbc'} {t1<t2
1b40: 7d 20 30 0a 74 65 73 74 5f 65 78 70 72 20 65 78  } 0.test_expr ex
1b50: 70 72 2d 34 2e 34 20 7b 74 31 3d 27 61 62 63 27  pr-4.4 {t1='abc'
1b60: 2c 20 74 32 3d 27 42 62 63 27 7d 20 7b 74 31 3e  , t2='Bbc'} {t1>
1b70: 74 32 7d 20 31 0a 74 65 73 74 5f 65 78 70 72 20  t2} 1.test_expr 
1b80: 65 78 70 72 2d 34 2e 35 20 7b 74 31 3d 27 30 27  expr-4.5 {t1='0'
1b90: 2c 20 74 32 3d 27 30 2e 30 27 7d 20 7b 74 31 3d  , t2='0.0'} {t1=
1ba0: 3d 74 32 7d 20 31 0a 74 65 73 74 5f 65 78 70 72  =t2} 1.test_expr
1bb0: 20 65 78 70 72 2d 34 2e 36 20 7b 74 31 3d 27 30   expr-4.6 {t1='0
1bc0: 2e 30 30 30 27 2c 20 74 32 3d 27 30 2e 30 27 7d  .000', t2='0.0'}
1bd0: 20 7b 74 31 3d 3d 74 32 7d 20 31 0a 74 65 73 74   {t1==t2} 1.test
1be0: 5f 65 78 70 72 20 65 78 70 72 2d 34 2e 37 20 7b  _expr expr-4.7 {
1bf0: 74 31 3d 27 20 30 2e 30 30 30 27 2c 20 74 32 3d  t1=' 0.000', t2=
1c00: 27 20 30 2e 30 27 7d 20 7b 74 31 3d 3d 74 32 7d  ' 0.0'} {t1==t2}
1c10: 20 30 0a 74 65 73 74 5f 65 78 70 72 20 65 78 70   0.test_expr exp
1c20: 72 2d 34 2e 38 20 7b 74 31 3d 27 30 2e 30 27 2c  r-4.8 {t1='0.0',
1c30: 20 74 32 3d 27 61 62 63 27 7d 20 7b 74 31 3c 74   t2='abc'} {t1<t
1c40: 32 7d 20 31 0a 74 65 73 74 5f 65 78 70 72 20 65  2} 1.test_expr e
1c50: 78 70 72 2d 34 2e 39 20 7b 74 31 3d 27 30 2e 30  xpr-4.9 {t1='0.0
1c60: 27 2c 20 74 32 3d 27 61 62 63 27 7d 20 7b 74 31  ', t2='abc'} {t1
1c70: 3d 3d 74 32 7d 20 30 0a 74 65 73 74 5f 65 78 70  ==t2} 0.test_exp
1c80: 72 20 65 78 70 72 2d 34 2e 31 30 20 7b 74 31 3d  r expr-4.10 {t1=
1c90: 27 30 2e 30 27 2c 20 74 32 3d 27 61 62 63 27 7d  '0.0', t2='abc'}
1ca0: 20 7b 74 31 3e 74 32 7d 20 30 0a 0a 74 65 73 74   {t1>t2} 0..test
1cb0: 5f 65 78 70 72 20 65 78 70 72 2d 35 2e 31 20 7b  _expr expr-5.1 {
1cc0: 74 31 3d 27 61 62 63 27 2c 20 74 32 3d 27 78 79  t1='abc', t2='xy
1cd0: 7a 27 7d 20 7b 74 31 20 4c 49 4b 45 20 74 32 7d  z'} {t1 LIKE t2}
1ce0: 20 30 0a 74 65 73 74 5f 65 78 70 72 20 65 78 70   0.test_expr exp
1cf0: 72 2d 35 2e 32 20 7b 74 31 3d 27 61 62 63 27 2c  r-5.2 {t1='abc',
1d00: 20 74 32 3d 27 41 42 43 27 7d 20 7b 74 31 20 4c   t2='ABC'} {t1 L
1d10: 49 4b 45 20 74 32 7d 20 31 0a 74 65 73 74 5f 65  IKE t2} 1.test_e
1d20: 78 70 72 20 65 78 70 72 2d 35 2e 33 20 7b 74 31  xpr expr-5.3 {t1
1d30: 3d 27 61 62 63 27 2c 20 74 32 3d 27 41 5f 43 27  ='abc', t2='A_C'
1d40: 7d 20 7b 74 31 20 4c 49 4b 45 20 74 32 7d 20 31  } {t1 LIKE t2} 1
1d50: 0a 74 65 73 74 5f 65 78 70 72 20 65 78 70 72 2d  .test_expr expr-
1d60: 35 2e 34 20 7b 74 31 3d 27 61 62 63 27 2c 20 74  5.4 {t1='abc', t
1d70: 32 3d 27 61 62 63 5f 27 7d 20 7b 74 31 20 4c 49  2='abc_'} {t1 LI
1d80: 4b 45 20 74 32 7d 20 30 0a 74 65 73 74 5f 65 78  KE t2} 0.test_ex
1d90: 70 72 20 65 78 70 72 2d 35 2e 35 20 7b 74 31 3d  pr expr-5.5 {t1=
1da0: 27 61 62 63 27 2c 20 74 32 3d 27 41 25 43 27 7d  'abc', t2='A%C'}
1db0: 20 7b 74 31 20 4c 49 4b 45 20 74 32 7d 20 31 0a   {t1 LIKE t2} 1.
1dc0: 74 65 73 74 5f 65 78 70 72 20 65 78 70 72 2d 35  test_expr expr-5
1dd0: 2e 35 62 20 7b 74 31 3d 27 61 63 27 2c 20 74 32  .5b {t1='ac', t2
1de0: 3d 27 41 25 43 27 7d 20 7b 74 31 20 4c 49 4b 45  ='A%C'} {t1 LIKE
1df0: 20 74 32 7d 20 31 0a 74 65 73 74 5f 65 78 70 72   t2} 1.test_expr
1e00: 20 65 78 70 72 2d 35 2e 36 20 7b 74 31 3d 27 61   expr-5.6 {t1='a
1e10: 62 78 79 7a 7a 79 63 27 2c 20 74 32 3d 27 41 25  bxyzzyc', t2='A%
1e20: 43 27 7d 20 7b 74 31 20 4c 49 4b 45 20 74 32 7d  C'} {t1 LIKE t2}
1e30: 20 31 0a 74 65 73 74 5f 65 78 70 72 20 65 78 70   1.test_expr exp
1e40: 72 2d 35 2e 37 20 7b 74 31 3d 27 61 62 78 79 7a  r-5.7 {t1='abxyz
1e50: 7a 79 27 2c 20 74 32 3d 27 41 25 43 27 7d 20 7b  zy', t2='A%C'} {
1e60: 74 31 20 4c 49 4b 45 20 74 32 7d 20 30 0a 74 65  t1 LIKE t2} 0.te
1e70: 73 74 5f 65 78 70 72 20 65 78 70 72 2d 35 2e 38  st_expr expr-5.8
1e80: 20 7b 74 31 3d 27 61 62 78 79 7a 7a 79 63 78 27   {t1='abxyzzycx'
1e90: 2c 20 74 32 3d 27 41 25 43 27 7d 20 7b 74 31 20  , t2='A%C'} {t1 
1ea0: 4c 49 4b 45 20 74 32 7d 20 30 0a 74 65 73 74 5f  LIKE t2} 0.test_
1eb0: 65 78 70 72 20 65 78 70 72 2d 35 2e 38 62 20 7b  expr expr-5.8b {
1ec0: 74 31 3d 27 61 62 78 79 7a 7a 79 63 79 27 2c 20  t1='abxyzzycy', 
1ed0: 74 32 3d 27 41 25 43 58 27 7d 20 7b 74 31 20 4c  t2='A%CX'} {t1 L
1ee0: 49 4b 45 20 74 32 7d 20 30 0a 74 65 73 74 5f 65  IKE t2} 0.test_e
1ef0: 78 70 72 20 65 78 70 72 2d 35 2e 39 20 7b 74 31  xpr expr-5.9 {t1
1f00: 3d 27 61 62 63 27 2c 20 74 32 3d 27 41 25 5f 43  ='abc', t2='A%_C
1f10: 27 7d 20 7b 74 31 20 4c 49 4b 45 20 74 32 7d 20  '} {t1 LIKE t2} 
1f20: 31 0a 74 65 73 74 5f 65 78 70 72 20 65 78 70 72  1.test_expr expr
1f30: 2d 35 2e 39 62 20 7b 74 31 3d 27 61 63 27 2c 20  -5.9b {t1='ac', 
1f40: 74 32 3d 27 41 25 5f 43 27 7d 20 7b 74 31 20 4c  t2='A%_C'} {t1 L
1f50: 49 4b 45 20 74 32 7d 20 30 0a 74 65 73 74 5f 65  IKE t2} 0.test_e
1f60: 78 70 72 20 65 78 70 72 2d 35 2e 31 30 20 7b 74  xpr expr-5.10 {t
1f70: 31 3d 27 61 62 78 79 7a 7a 79 63 27 2c 20 74 32  1='abxyzzyc', t2
1f80: 3d 27 41 25 5f 43 27 7d 20 7b 74 31 20 4c 49 4b  ='A%_C'} {t1 LIK
1f90: 45 20 74 32 7d 20 31 0a 74 65 73 74 5f 65 78 70  E t2} 1.test_exp
1fa0: 72 20 65 78 70 72 2d 35 2e 31 31 20 7b 74 31 3d  r expr-5.11 {t1=
1fb0: 27 61 62 63 27 2c 20 74 32 3d 27 78 79 7a 27 7d  'abc', t2='xyz'}
1fc0: 20 7b 74 31 20 4e 4f 54 20 4c 49 4b 45 20 74 32   {t1 NOT LIKE t2
1fd0: 7d 20 31 0a 74 65 73 74 5f 65 78 70 72 20 65 78  } 1.test_expr ex
1fe0: 70 72 2d 35 2e 31 32 20 7b 74 31 3d 27 61 62 63  pr-5.12 {t1='abc
1ff0: 27 2c 20 74 32 3d 27 41 42 43 27 7d 20 7b 74 31  ', t2='ABC'} {t1
2000: 20 4e 4f 54 20 4c 49 4b 45 20 74 32 7d 20 30 0a   NOT LIKE t2} 0.
2010: 0a 23 20 54 68 65 20 66 6f 6c 6c 6f 77 69 6e 67  .# The following
2020: 20 74 65 73 74 73 20 6f 6e 6c 79 20 77 6f 72 6b   tests only work
2030: 20 6f 6e 20 76 65 72 73 69 6f 6e 73 20 6f 66 20   on versions of 
2040: 54 43 4c 20 74 68 61 74 20 73 75 70 70 6f 72 74  TCL that support
2050: 0a 23 20 55 6e 69 63 6f 64 65 20 61 6e 64 20 53  .# Unicode and S
2060: 51 4c 69 74 65 20 63 6f 6e 66 69 67 75 72 65 64  QLite configured
2070: 20 66 6f 72 20 55 54 46 2d 38 20 73 75 70 70 6f   for UTF-8 suppo
2080: 72 74 2e 0a 23 0a 69 66 20 7b 22 5c 75 31 32 33  rt..#.if {"\u123
2090: 34 22 21 3d 22 75 31 32 33 34 22 20 26 26 20 5b  4"!="u1234" && [
20a0: 73 71 6c 69 74 65 20 2d 65 6e 63 6f 64 69 6e 67  sqlite -encoding
20b0: 5d 3d 3d 22 55 54 46 2d 38 22 7d 20 7b 0a 20 20  ]=="UTF-8"} {.  
20c0: 74 65 73 74 5f 65 78 70 72 20 65 78 70 72 2d 35  test_expr expr-5
20d0: 2e 31 33 20 22 74 31 3d 27 61 5c 75 30 30 38 30  .13 "t1='a\u0080
20e0: 63 27 2c 20 74 32 3d 27 41 5f 43 27 22 20 7b 74  c', t2='A_C'" {t
20f0: 31 20 4c 49 4b 45 20 74 32 7d 20 31 0a 20 20 74  1 LIKE t2} 1.  t
2100: 65 73 74 5f 65 78 70 72 20 65 78 70 72 2d 35 2e  est_expr expr-5.
2110: 31 34 20 22 74 31 3d 27 61 5c 75 30 37 46 46 63  14 "t1='a\u07FFc
2120: 27 2c 20 74 32 3d 27 41 5f 43 27 22 20 7b 74 31  ', t2='A_C'" {t1
2130: 20 4c 49 4b 45 20 74 32 7d 20 31 0a 20 20 74 65   LIKE t2} 1.  te
2140: 73 74 5f 65 78 70 72 20 65 78 70 72 2d 35 2e 31  st_expr expr-5.1
2150: 35 20 22 74 31 3d 27 61 5c 75 30 38 30 30 63 27  5 "t1='a\u0800c'
2160: 2c 20 74 32 3d 27 41 5f 43 27 22 20 7b 74 31 20  , t2='A_C'" {t1 
2170: 4c 49 4b 45 20 74 32 7d 20 31 0a 20 20 74 65 73  LIKE t2} 1.  tes
2180: 74 5f 65 78 70 72 20 65 78 70 72 2d 35 2e 31 36  t_expr expr-5.16
2190: 20 22 74 31 3d 27 61 5c 75 46 46 46 46 63 27 2c   "t1='a\uFFFFc',
21a0: 20 74 32 3d 27 41 5f 43 27 22 20 7b 74 31 20 4c   t2='A_C'" {t1 L
21b0: 49 4b 45 20 74 32 7d 20 31 0a 20 20 74 65 73 74  IKE t2} 1.  test
21c0: 5f 65 78 70 72 20 65 78 70 72 2d 35 2e 31 37 20  _expr expr-5.17 
21d0: 22 74 31 3d 27 61 5c 75 30 30 38 30 27 2c 20 74  "t1='a\u0080', t
21e0: 32 3d 27 41 5f 5f 27 22 20 7b 74 31 20 4c 49 4b  2='A__'" {t1 LIK
21f0: 45 20 74 32 7d 20 30 0a 20 20 74 65 73 74 5f 65  E t2} 0.  test_e
2200: 78 70 72 20 65 78 70 72 2d 35 2e 31 38 20 22 74  xpr expr-5.18 "t
2210: 31 3d 27 61 5c 75 30 37 46 46 27 2c 20 74 32 3d  1='a\u07FF', t2=
2220: 27 41 5f 5f 27 22 20 7b 74 31 20 4c 49 4b 45 20  'A__'" {t1 LIKE 
2230: 74 32 7d 20 30 0a 20 20 74 65 73 74 5f 65 78 70  t2} 0.  test_exp
2240: 72 20 65 78 70 72 2d 35 2e 31 39 20 22 74 31 3d  r expr-5.19 "t1=
2250: 27 61 5c 75 30 38 30 30 27 2c 20 74 32 3d 27 41  'a\u0800', t2='A
2260: 5f 5f 27 22 20 7b 74 31 20 4c 49 4b 45 20 74 32  __'" {t1 LIKE t2
2270: 7d 20 30 0a 20 20 74 65 73 74 5f 65 78 70 72 20  } 0.  test_expr 
2280: 65 78 70 72 2d 35 2e 32 30 20 22 74 31 3d 27 61  expr-5.20 "t1='a
2290: 5c 75 46 46 46 46 27 2c 20 74 32 3d 27 41 5f 5f  \uFFFF', t2='A__
22a0: 27 22 20 7b 74 31 20 4c 49 4b 45 20 74 32 7d 20  '" {t1 LIKE t2} 
22b0: 30 0a 20 20 74 65 73 74 5f 65 78 70 72 20 65 78  0.  test_expr ex
22c0: 70 72 2d 35 2e 32 31 20 22 74 31 3d 27 61 78 5c  pr-5.21 "t1='ax\
22d0: 75 41 42 43 44 27 2c 20 74 32 3d 27 41 5f 5c 75  uABCD', t2='A_\u
22e0: 41 42 43 44 27 22 20 7b 74 31 20 4c 49 4b 45 20  ABCD'" {t1 LIKE 
22f0: 74 32 7d 20 31 0a 20 20 74 65 73 74 5f 65 78 70  t2} 1.  test_exp
2300: 72 20 65 78 70 72 2d 35 2e 32 32 20 22 74 31 3d  r expr-5.22 "t1=
2310: 27 61 78 5c 75 31 32 33 34 27 2c 20 74 32 3d 27  'ax\u1234', t2='
2320: 41 25 5c 75 31 32 33 34 27 22 20 7b 74 31 20 4c  A%\u1234'" {t1 L
2330: 49 4b 45 20 74 32 7d 20 31 0a 20 20 74 65 73 74  IKE t2} 1.  test
2340: 5f 65 78 70 72 20 65 78 70 72 2d 35 2e 32 33 20  _expr expr-5.23 
2350: 22 74 31 3d 27 61 78 5c 75 46 45 44 43 27 2c 20  "t1='ax\uFEDC', 
2360: 74 32 3d 27 41 5f 25 27 22 20 7b 74 31 20 4c 49  t2='A_%'" {t1 LI
2370: 4b 45 20 74 32 7d 20 31 0a 20 20 74 65 73 74 5f  KE t2} 1.  test_
2380: 65 78 70 72 20 65 78 70 72 2d 35 2e 32 34 20 22  expr expr-5.24 "
2390: 74 31 3d 27 61 78 5c 75 46 45 44 43 79 5c 75 46  t1='ax\uFEDCy\uF
23a0: 45 44 43 27 2c 20 74 32 3d 27 41 25 5c 75 46 45  EDC', t2='A%\uFE
23b0: 44 43 27 22 20 7b 74 31 20 4c 49 4b 45 20 74 32  DC'" {t1 LIKE t2
23c0: 7d 20 31 0a 7d 0a 0a 23 20 54 68 65 73 65 73 20  } 1.}..# Theses 
23d0: 74 65 73 74 73 20 61 72 65 20 66 6f 72 20 77 68  tests are for wh
23e0: 65 6e 20 53 51 4c 69 74 65 20 61 73 73 75 6d 65  en SQLite assume
23f0: 73 20 69 73 6f 38 38 35 39 20 63 68 61 72 61 63  s iso8859 charac
2400: 74 65 72 73 2e 0a 23 0a 69 66 20 7b 5b 73 71 6c  ters..#.if {[sql
2410: 69 74 65 20 2d 65 6e 63 6f 64 69 6e 67 5d 3d 3d  ite -encoding]==
2420: 22 69 73 6f 38 38 35 39 22 7d 20 7b 0a 20 20 73  "iso8859"} {.  s
2430: 65 74 20 67 6f 20 31 0a 20 20 69 66 20 7b 5b 69  et go 1.  if {[i
2440: 6e 66 6f 20 63 6f 6d 6d 61 6e 64 20 65 6e 63 6f  nfo command enco
2450: 64 69 6e 67 5d 21 3d 22 22 7d 20 7b 0a 20 20 20  ding]!=""} {.   
2460: 20 69 66 20 7b 5b 63 61 74 63 68 20 7b 65 6e 63   if {[catch {enc
2470: 6f 64 69 6e 67 20 73 79 73 74 65 6d 20 69 73 6f  oding system iso
2480: 38 38 35 39 2d 31 7d 20 6d 73 67 5d 7d 20 7b 0a  8859-1} msg]} {.
2490: 20 20 20 20 20 20 70 75 74 73 20 22 73 6b 69 70        puts "skip
24a0: 70 69 6e 67 20 74 65 73 74 73 20 6f 66 20 4c 49  ping tests of LI
24b0: 4b 45 20 6f 70 65 72 61 74 6f 72 3a 20 24 6d 73  KE operator: $ms
24c0: 67 22 0a 20 20 20 20 20 20 73 65 74 20 67 6f 20  g".      set go 
24d0: 30 0a 20 20 20 20 7d 0a 20 20 7d 0a 20 20 69 66  0.    }.  }.  if
24e0: 20 7b 24 67 6f 7d 20 7b 0a 20 20 20 20 74 65 73   {$go} {.    tes
24f0: 74 5f 65 78 70 72 20 65 78 70 72 2d 35 2e 35 30  t_expr expr-5.50
2500: 20 22 74 31 3d 27 61 5c 32 36 36 63 27 2c 20 74   "t1='a\266c', t
2510: 32 3d 27 41 5f 43 27 22 20 20 7b 74 31 20 4c 49  2='A_C'"  {t1 LI
2520: 4b 45 20 74 32 7d 20 31 0a 20 20 20 20 74 65 73  KE t2} 1.    tes
2530: 74 5f 65 78 70 72 20 65 78 70 72 2d 35 2e 35 31  t_expr expr-5.51
2540: 20 22 74 31 3d 27 61 5c 33 34 37 27 2c 20 74 32   "t1='a\347', t2
2550: 3d 27 41 5f 27 22 20 20 7b 74 31 20 4c 49 4b 45  ='A_'"  {t1 LIKE
2560: 20 74 32 7d 20 31 0a 20 20 20 20 74 65 73 74 5f   t2} 1.    test_
2570: 65 78 70 72 20 65 78 70 72 2d 35 2e 35 32 20 22  expr expr-5.52 "
2580: 74 31 3d 27 61 78 5c 33 35 31 27 2c 20 74 32 3d  t1='ax\351', t2=
2590: 27 41 5f 5c 33 35 31 27 22 20 20 7b 74 31 20 4c  'A_\351'"  {t1 L
25a0: 49 4b 45 20 74 32 7d 20 31 0a 20 20 20 20 74 65  IKE t2} 1.    te
25b0: 73 74 5f 65 78 70 72 20 65 78 70 72 2d 35 2e 35  st_expr expr-5.5
25c0: 33 20 22 74 31 3d 27 61 78 5c 32 34 31 27 2c 20  3 "t1='ax\241', 
25d0: 74 32 3d 27 41 5f 25 27 22 20 20 7b 74 31 20 4c  t2='A_%'"  {t1 L
25e0: 49 4b 45 20 74 32 7d 20 31 0a 20 20 7d 0a 7d 0a  IKE t2} 1.  }.}.
25f0: 0a 74 65 73 74 5f 65 78 70 72 20 65 78 70 72 2d  .test_expr expr-
2600: 36 2e 31 20 7b 74 31 3d 27 61 62 63 27 2c 20 74  6.1 {t1='abc', t
2610: 32 3d 27 78 79 7a 27 7d 20 7b 74 31 20 47 4c 4f  2='xyz'} {t1 GLO
2620: 42 20 74 32 7d 20 30 0a 74 65 73 74 5f 65 78 70  B t2} 0.test_exp
2630: 72 20 65 78 70 72 2d 36 2e 32 20 7b 74 31 3d 27  r expr-6.2 {t1='
2640: 61 62 63 27 2c 20 74 32 3d 27 41 42 43 27 7d 20  abc', t2='ABC'} 
2650: 7b 74 31 20 47 4c 4f 42 20 74 32 7d 20 30 0a 74  {t1 GLOB t2} 0.t
2660: 65 73 74 5f 65 78 70 72 20 65 78 70 72 2d 36 2e  est_expr expr-6.
2670: 33 20 7b 74 31 3d 27 61 62 63 27 2c 20 74 32 3d  3 {t1='abc', t2=
2680: 27 41 3f 43 27 7d 20 7b 74 31 20 47 4c 4f 42 20  'A?C'} {t1 GLOB 
2690: 74 32 7d 20 30 0a 74 65 73 74 5f 65 78 70 72 20  t2} 0.test_expr 
26a0: 65 78 70 72 2d 36 2e 34 20 7b 74 31 3d 27 61 62  expr-6.4 {t1='ab
26b0: 63 27 2c 20 74 32 3d 27 61 3f 63 27 7d 20 7b 74  c', t2='a?c'} {t
26c0: 31 20 47 4c 4f 42 20 74 32 7d 20 31 0a 74 65 73  1 GLOB t2} 1.tes
26d0: 74 5f 65 78 70 72 20 65 78 70 72 2d 36 2e 35 20  t_expr expr-6.5 
26e0: 7b 74 31 3d 27 61 62 63 27 2c 20 74 32 3d 27 61  {t1='abc', t2='a
26f0: 62 63 3f 27 7d 20 7b 74 31 20 47 4c 4f 42 20 74  bc?'} {t1 GLOB t
2700: 32 7d 20 30 0a 74 65 73 74 5f 65 78 70 72 20 65  2} 0.test_expr e
2710: 78 70 72 2d 36 2e 36 20 7b 74 31 3d 27 61 62 63  xpr-6.6 {t1='abc
2720: 27 2c 20 74 32 3d 27 41 2a 43 27 7d 20 7b 74 31  ', t2='A*C'} {t1
2730: 20 47 4c 4f 42 20 74 32 7d 20 30 0a 74 65 73 74   GLOB t2} 0.test
2740: 5f 65 78 70 72 20 65 78 70 72 2d 36 2e 37 20 7b  _expr expr-6.7 {
2750: 74 31 3d 27 61 62 63 27 2c 20 74 32 3d 27 61 2a  t1='abc', t2='a*
2760: 63 27 7d 20 7b 74 31 20 47 4c 4f 42 20 74 32 7d  c'} {t1 GLOB t2}
2770: 20 31 0a 74 65 73 74 5f 65 78 70 72 20 65 78 70   1.test_expr exp
2780: 72 2d 36 2e 38 20 7b 74 31 3d 27 61 62 78 79 7a  r-6.8 {t1='abxyz
2790: 7a 79 63 27 2c 20 74 32 3d 27 61 2a 63 27 7d 20  zyc', t2='a*c'} 
27a0: 7b 74 31 20 47 4c 4f 42 20 74 32 7d 20 31 0a 74  {t1 GLOB t2} 1.t
27b0: 65 73 74 5f 65 78 70 72 20 65 78 70 72 2d 36 2e  est_expr expr-6.
27c0: 39 20 7b 74 31 3d 27 61 62 78 79 7a 7a 79 27 2c  9 {t1='abxyzzy',
27d0: 20 74 32 3d 27 61 2a 63 27 7d 20 7b 74 31 20 47   t2='a*c'} {t1 G
27e0: 4c 4f 42 20 74 32 7d 20 30 0a 74 65 73 74 5f 65  LOB t2} 0.test_e
27f0: 78 70 72 20 65 78 70 72 2d 36 2e 31 30 20 7b 74  xpr expr-6.10 {t
2800: 31 3d 27 61 62 78 79 7a 7a 79 63 78 27 2c 20 74  1='abxyzzycx', t
2810: 32 3d 27 61 2a 63 27 7d 20 7b 74 31 20 47 4c 4f  2='a*c'} {t1 GLO
2820: 42 20 74 32 7d 20 30 0a 74 65 73 74 5f 65 78 70  B t2} 0.test_exp
2830: 72 20 65 78 70 72 2d 36 2e 31 31 20 7b 74 31 3d  r expr-6.11 {t1=
2840: 27 61 62 63 27 2c 20 74 32 3d 27 78 79 7a 27 7d  'abc', t2='xyz'}
2850: 20 7b 74 31 20 4e 4f 54 20 47 4c 4f 42 20 74 32   {t1 NOT GLOB t2
2860: 7d 20 31 0a 74 65 73 74 5f 65 78 70 72 20 65 78  } 1.test_expr ex
2870: 70 72 2d 36 2e 31 32 20 7b 74 31 3d 27 61 62 63  pr-6.12 {t1='abc
2880: 27 2c 20 74 32 3d 27 61 62 63 27 7d 20 7b 74 31  ', t2='abc'} {t1
2890: 20 4e 4f 54 20 47 4c 4f 42 20 74 32 7d 20 30 0a   NOT GLOB t2} 0.
28a0: 74 65 73 74 5f 65 78 70 72 20 65 78 70 72 2d 36  test_expr expr-6
28b0: 2e 31 33 20 7b 74 31 3d 27 61 62 63 27 2c 20 74  .13 {t1='abc', t
28c0: 32 3d 27 61 5b 62 78 5d 63 27 7d 20 7b 74 31 20  2='a[bx]c'} {t1 
28d0: 47 4c 4f 42 20 74 32 7d 20 31 0a 74 65 73 74 5f  GLOB t2} 1.test_
28e0: 65 78 70 72 20 65 78 70 72 2d 36 2e 31 34 20 7b  expr expr-6.14 {
28f0: 74 31 3d 27 61 62 63 27 2c 20 74 32 3d 27 61 5b  t1='abc', t2='a[
2900: 63 78 5d 63 27 7d 20 7b 74 31 20 47 4c 4f 42 20  cx]c'} {t1 GLOB 
2910: 74 32 7d 20 30 0a 74 65 73 74 5f 65 78 70 72 20  t2} 0.test_expr 
2920: 65 78 70 72 2d 36 2e 31 35 20 7b 74 31 3d 27 61  expr-6.15 {t1='a
2930: 62 63 27 2c 20 74 32 3d 27 61 5b 61 2d 64 5d 63  bc', t2='a[a-d]c
2940: 27 7d 20 7b 74 31 20 47 4c 4f 42 20 74 32 7d 20  '} {t1 GLOB t2} 
2950: 31 0a 74 65 73 74 5f 65 78 70 72 20 65 78 70 72  1.test_expr expr
2960: 2d 36 2e 31 36 20 7b 74 31 3d 27 61 62 63 27 2c  -6.16 {t1='abc',
2970: 20 74 32 3d 27 61 5b 5e 61 2d 64 5d 63 27 7d 20   t2='a[^a-d]c'} 
2980: 7b 74 31 20 47 4c 4f 42 20 74 32 7d 20 30 0a 74  {t1 GLOB t2} 0.t
2990: 65 73 74 5f 65 78 70 72 20 65 78 70 72 2d 36 2e  est_expr expr-6.
29a0: 31 37 20 7b 74 31 3d 27 61 62 63 27 2c 20 74 32  17 {t1='abc', t2
29b0: 3d 27 61 5b 41 2d 44 63 5d 63 27 7d 20 7b 74 31  ='a[A-Dc]c'} {t1
29c0: 20 47 4c 4f 42 20 74 32 7d 20 30 0a 74 65 73 74   GLOB t2} 0.test
29d0: 5f 65 78 70 72 20 65 78 70 72 2d 36 2e 31 38 20  _expr expr-6.18 
29e0: 7b 74 31 3d 27 61 62 63 27 2c 20 74 32 3d 27 61  {t1='abc', t2='a
29f0: 5b 5e 41 2d 44 63 5d 63 27 7d 20 7b 74 31 20 47  [^A-Dc]c'} {t1 G
2a00: 4c 4f 42 20 74 32 7d 20 31 0a 74 65 73 74 5f 65  LOB t2} 1.test_e
2a10: 78 70 72 20 65 78 70 72 2d 36 2e 31 39 20 7b 74  xpr expr-6.19 {t
2a20: 31 3d 27 61 62 63 27 2c 20 74 32 3d 27 61 5b 5d  1='abc', t2='a[]
2a30: 62 5d 63 27 7d 20 7b 74 31 20 47 4c 4f 42 20 74  b]c'} {t1 GLOB t
2a40: 32 7d 20 31 0a 74 65 73 74 5f 65 78 70 72 20 65  2} 1.test_expr e
2a50: 78 70 72 2d 36 2e 32 30 20 7b 74 31 3d 27 61 62  xpr-6.20 {t1='ab
2a60: 63 27 2c 20 74 32 3d 27 61 5b 5e 5d 62 5d 63 27  c', t2='a[^]b]c'
2a70: 7d 20 7b 74 31 20 47 4c 4f 42 20 74 32 7d 20 30  } {t1 GLOB t2} 0
2a80: 0a 74 65 73 74 5f 65 78 70 72 20 65 78 70 72 2d  .test_expr expr-
2a90: 36 2e 32 31 20 7b 74 31 3d 27 61 62 63 64 65 66  6.21 {t1='abcdef
2aa0: 67 27 2c 20 74 32 3d 27 61 2a 5b 64 65 5d 67 27  g', t2='a*[de]g'
2ab0: 7d 20 7b 74 31 20 47 4c 4f 42 20 74 32 7d 20 30  } {t1 GLOB t2} 0
2ac0: 0a 74 65 73 74 5f 65 78 70 72 20 65 78 70 72 2d  .test_expr expr-
2ad0: 36 2e 32 32 20 7b 74 31 3d 27 61 62 63 64 65 66  6.22 {t1='abcdef
2ae0: 67 27 2c 20 74 32 3d 27 61 2a 5b 5e 64 65 5d 67  g', t2='a*[^de]g
2af0: 27 7d 20 7b 74 31 20 47 4c 4f 42 20 74 32 7d 20  '} {t1 GLOB t2} 
2b00: 31 0a 74 65 73 74 5f 65 78 70 72 20 65 78 70 72  1.test_expr expr
2b10: 2d 36 2e 32 33 20 7b 74 31 3d 27 61 62 63 64 65  -6.23 {t1='abcde
2b20: 66 67 27 2c 20 74 32 3d 27 61 2a 3f 67 27 7d 20  fg', t2='a*?g'} 
2b30: 7b 74 31 20 47 4c 4f 42 20 74 32 7d 20 31 0a 74  {t1 GLOB t2} 1.t
2b40: 65 73 74 5f 65 78 70 72 20 65 78 70 72 2d 36 2e  est_expr expr-6.
2b50: 32 34 20 7b 74 31 3d 27 61 63 27 2c 20 74 32 3d  24 {t1='ac', t2=
2b60: 27 61 2a 63 27 7d 20 7b 74 31 20 47 4c 4f 42 20  'a*c'} {t1 GLOB 
2b70: 74 32 7d 20 31 0a 74 65 73 74 5f 65 78 70 72 20  t2} 1.test_expr 
2b80: 65 78 70 72 2d 36 2e 32 35 20 7b 74 31 3d 27 61  expr-6.25 {t1='a
2b90: 63 27 2c 20 74 32 3d 27 61 2a 3f 63 27 7d 20 7b  c', t2='a*?c'} {
2ba0: 74 31 20 47 4c 4f 42 20 74 32 7d 20 30 0a 0a 23  t1 GLOB t2} 0..#
2bb0: 20 54 68 65 73 65 20 74 65 73 74 73 20 6f 6e 6c   These tests onl
2bc0: 79 20 77 6f 72 6b 20 6f 6e 20 76 65 72 73 69 6f  y work on versio
2bd0: 6e 73 20 6f 66 20 54 43 4c 20 74 68 61 74 20 73  ns of TCL that s
2be0: 75 70 70 6f 72 74 20 55 6e 69 63 6f 64 65 0a 23  upport Unicode.#
2bf0: 0a 69 66 20 7b 22 5c 75 31 32 33 34 22 21 3d 22  .if {"\u1234"!="
2c00: 75 31 32 33 34 22 20 26 26 20 5b 73 71 6c 69 74  u1234" && [sqlit
2c10: 65 20 2d 65 6e 63 6f 64 69 6e 67 5d 3d 3d 22 55  e -encoding]=="U
2c20: 54 46 2d 38 22 7d 20 7b 0a 20 20 74 65 73 74 5f  TF-8"} {.  test_
2c30: 65 78 70 72 20 65 78 70 72 2d 36 2e 32 36 20 22  expr expr-6.26 "
2c40: 74 31 3d 27 61 5c 75 30 30 38 30 63 27 2c 20 74  t1='a\u0080c', t
2c50: 32 3d 27 61 3f 63 27 22 20 7b 74 31 20 47 4c 4f  2='a?c'" {t1 GLO
2c60: 42 20 74 32 7d 20 31 0a 20 20 74 65 73 74 5f 65  B t2} 1.  test_e
2c70: 78 70 72 20 65 78 70 72 2d 36 2e 32 37 20 22 74  xpr expr-6.27 "t
2c80: 31 3d 27 61 5c 75 30 37 66 66 63 27 2c 20 74 32  1='a\u07ffc', t2
2c90: 3d 27 61 3f 63 27 22 20 7b 74 31 20 47 4c 4f 42  ='a?c'" {t1 GLOB
2ca0: 20 74 32 7d 20 31 0a 20 20 74 65 73 74 5f 65 78   t2} 1.  test_ex
2cb0: 70 72 20 65 78 70 72 2d 36 2e 32 38 20 22 74 31  pr expr-6.28 "t1
2cc0: 3d 27 61 5c 75 30 38 30 30 63 27 2c 20 74 32 3d  ='a\u0800c', t2=
2cd0: 27 61 3f 63 27 22 20 7b 74 31 20 47 4c 4f 42 20  'a?c'" {t1 GLOB 
2ce0: 74 32 7d 20 31 0a 20 20 74 65 73 74 5f 65 78 70  t2} 1.  test_exp
2cf0: 72 20 65 78 70 72 2d 36 2e 32 39 20 22 74 31 3d  r expr-6.29 "t1=
2d00: 27 61 5c 75 66 66 66 66 63 27 2c 20 74 32 3d 27  'a\uffffc', t2='
2d10: 61 3f 63 27 22 20 7b 74 31 20 47 4c 4f 42 20 74  a?c'" {t1 GLOB t
2d20: 32 7d 20 31 0a 20 20 74 65 73 74 5f 65 78 70 72  2} 1.  test_expr
2d30: 20 65 78 70 72 2d 36 2e 33 30 20 22 74 31 3d 27   expr-6.30 "t1='
2d40: 61 5c 75 31 32 33 34 27 2c 20 74 32 3d 27 61 3f  a\u1234', t2='a?
2d50: 27 22 20 7b 74 31 20 47 4c 4f 42 20 74 32 7d 20  '" {t1 GLOB t2} 
2d60: 31 0a 20 20 74 65 73 74 5f 65 78 70 72 20 65 78  1.  test_expr ex
2d70: 70 72 2d 36 2e 33 31 20 22 74 31 3d 27 61 5c 75  pr-6.31 "t1='a\u
2d80: 31 32 33 34 27 2c 20 74 32 3d 27 61 3f 3f 27 22  1234', t2='a??'"
2d90: 20 7b 74 31 20 47 4c 4f 42 20 74 32 7d 20 30 0a   {t1 GLOB t2} 0.
2da0: 20 20 74 65 73 74 5f 65 78 70 72 20 65 78 70 72    test_expr expr
2db0: 2d 36 2e 33 32 20 22 74 31 3d 27 61 78 5c 75 31  -6.32 "t1='ax\u1
2dc0: 32 33 34 27 2c 20 74 32 3d 27 61 3f 5c 75 31 32  234', t2='a?\u12
2dd0: 33 34 27 22 20 7b 74 31 20 47 4c 4f 42 20 74 32  34'" {t1 GLOB t2
2de0: 7d 20 31 0a 20 20 74 65 73 74 5f 65 78 70 72 20  } 1.  test_expr 
2df0: 65 78 70 72 2d 36 2e 33 33 20 22 74 31 3d 27 61  expr-6.33 "t1='a
2e00: 78 5c 75 31 32 33 34 27 2c 20 74 32 3d 27 61 2a  x\u1234', t2='a*
2e10: 5c 75 31 32 33 34 27 22 20 7b 74 31 20 47 4c 4f  \u1234'" {t1 GLO
2e20: 42 20 74 32 7d 20 31 0a 20 20 74 65 73 74 5f 65  B t2} 1.  test_e
2e30: 78 70 72 20 65 78 70 72 2d 36 2e 33 34 20 22 74  xpr expr-6.34 "t
2e40: 31 3d 27 61 78 5c 75 31 32 33 34 79 5c 75 31 32  1='ax\u1234y\u12
2e50: 33 34 27 2c 20 74 32 3d 27 61 2a 5c 75 31 32 33  34', t2='a*\u123
2e60: 34 27 22 20 7b 74 31 20 47 4c 4f 42 20 74 32 7d  4'" {t1 GLOB t2}
2e70: 20 31 0a 20 20 74 65 73 74 5f 65 78 70 72 20 65   1.  test_expr e
2e80: 78 70 72 2d 36 2e 33 35 20 22 74 31 3d 27 61 5c  xpr-6.35 "t1='a\
2e90: 75 31 32 33 34 62 27 2c 20 74 32 3d 27 61 5c 5b  u1234b', t2='a\[
2ea0: 78 5c 75 31 32 33 34 79 5c 5d 62 27 22 20 7b 74  x\u1234y\]b'" {t
2eb0: 31 20 47 4c 4f 42 20 74 32 7d 20 31 0a 20 20 74  1 GLOB t2} 1.  t
2ec0: 65 73 74 5f 65 78 70 72 20 65 78 70 72 2d 36 2e  est_expr expr-6.
2ed0: 33 36 20 22 74 31 3d 27 61 5c 75 31 32 33 34 62  36 "t1='a\u1234b
2ee0: 27 2c 20 74 32 3d 27 61 5c 5b 5c 75 31 32 33 33  ', t2='a\[\u1233
2ef0: 2d 5c 75 31 32 33 35 5c 5d 62 27 22 20 7b 74 31  -\u1235\]b'" {t1
2f00: 20 47 4c 4f 42 20 74 32 7d 20 31 0a 20 20 74 65   GLOB t2} 1.  te
2f10: 73 74 5f 65 78 70 72 20 65 78 70 72 2d 36 2e 33  st_expr expr-6.3
2f20: 37 20 22 74 31 3d 27 61 5c 75 31 32 33 34 62 27  7 "t1='a\u1234b'
2f30: 2c 20 74 32 3d 27 61 5c 5b 5c 75 31 32 33 34 2d  , t2='a\[\u1234-
2f40: 5c 75 31 32 34 66 5c 5d 62 27 22 20 7b 74 31 20  \u124f\]b'" {t1 
2f50: 47 4c 4f 42 20 74 32 7d 20 31 0a 20 20 74 65 73  GLOB t2} 1.  tes
2f60: 74 5f 65 78 70 72 20 65 78 70 72 2d 36 2e 33 38  t_expr expr-6.38
2f70: 20 22 74 31 3d 27 61 5c 75 31 32 33 34 62 27 2c   "t1='a\u1234b',
2f80: 20 74 32 3d 27 61 5c 5b 5c 75 31 32 33 35 2d 5c   t2='a\[\u1235-\
2f90: 75 31 32 34 66 5c 5d 62 27 22 20 7b 74 31 20 47  u124f\]b'" {t1 G
2fa0: 4c 4f 42 20 74 32 7d 20 30 0a 20 20 74 65 73 74  LOB t2} 0.  test
2fb0: 5f 65 78 70 72 20 65 78 70 72 2d 36 2e 33 39 20  _expr expr-6.39 
2fc0: 22 74 31 3d 27 61 5c 75 31 32 33 34 62 27 2c 20  "t1='a\u1234b', 
2fd0: 74 32 3d 27 61 5c 5b 61 2d 5c 75 31 32 33 35 5c  t2='a\[a-\u1235\
2fe0: 5d 62 27 22 20 7b 74 31 20 47 4c 4f 42 20 74 32  ]b'" {t1 GLOB t2
2ff0: 7d 20 31 0a 20 20 74 65 73 74 5f 65 78 70 72 20  } 1.  test_expr 
3000: 65 78 70 72 2d 36 2e 34 30 20 22 74 31 3d 27 61  expr-6.40 "t1='a
3010: 5c 75 31 32 33 34 62 27 2c 20 74 32 3d 27 61 5c  \u1234b', t2='a\
3020: 5b 61 2d 5c 75 31 32 33 34 5c 5d 62 27 22 20 7b  [a-\u1234\]b'" {
3030: 74 31 20 47 4c 4f 42 20 74 32 7d 20 31 0a 20 20  t1 GLOB t2} 1.  
3040: 74 65 73 74 5f 65 78 70 72 20 65 78 70 72 2d 36  test_expr expr-6
3050: 2e 34 31 20 22 74 31 3d 27 61 5c 75 31 32 33 34  .41 "t1='a\u1234
3060: 62 27 2c 20 74 32 3d 27 61 5c 5b 61 2d 5c 75 31  b', t2='a\[a-\u1
3070: 32 33 33 5c 5d 62 27 22 20 7b 74 31 20 47 4c 4f  233\]b'" {t1 GLO
3080: 42 20 74 32 7d 20 30 0a 7d 0a 0a 23 20 54 68 65  B t2} 0.}..# The
3090: 73 65 73 20 74 65 73 74 73 20 61 72 65 20 66 6f  ses tests are fo
30a0: 72 20 77 68 65 6e 20 53 51 4c 69 74 65 20 61 73  r when SQLite as
30b0: 73 75 6d 65 73 20 69 73 6f 38 38 35 39 20 63 68  sumes iso8859 ch
30c0: 61 72 61 63 74 65 72 73 2e 0a 23 0a 69 66 20 7b  aracters..#.if {
30d0: 5b 73 71 6c 69 74 65 20 2d 65 6e 63 6f 64 69 6e  [sqlite -encodin
30e0: 67 5d 3d 3d 22 69 73 6f 38 38 35 39 22 7d 20 7b  g]=="iso8859"} {
30f0: 0a 20 20 73 65 74 20 67 6f 20 31 0a 20 20 69 66  .  set go 1.  if
3100: 20 7b 5b 69 6e 66 6f 20 63 6f 6d 6d 61 6e 64 20   {[info command 
3110: 65 6e 63 6f 64 69 6e 67 5d 21 3d 22 22 7d 20 7b  encoding]!=""} {
3120: 0a 20 20 20 20 69 66 20 7b 5b 63 61 74 63 68 20  .    if {[catch 
3130: 7b 65 6e 63 6f 64 69 6e 67 20 73 79 73 74 65 6d  {encoding system
3140: 20 69 73 6f 38 38 35 39 2d 31 7d 20 6d 73 67 5d   iso8859-1} msg]
3150: 7d 20 7b 0a 20 20 20 20 20 20 70 75 74 73 20 22  } {.      puts "
3160: 73 6b 69 70 70 69 6e 67 20 74 65 73 74 73 20 6f  skipping tests o
3170: 66 20 47 4c 4f 42 20 6f 70 65 72 61 74 6f 72 3a  f GLOB operator:
3180: 20 24 6d 73 67 22 0a 20 20 20 20 20 20 73 65 74   $msg".      set
3190: 20 67 6f 20 30 0a 20 20 20 20 7d 0a 20 20 7d 0a   go 0.    }.  }.
31a0: 20 20 69 66 20 7b 24 67 6f 7d 20 7b 0a 20 20 20    if {$go} {.   
31b0: 20 74 65 73 74 5f 65 78 70 72 20 65 78 70 72 2d   test_expr expr-
31c0: 36 2e 35 30 20 22 74 31 3d 27 61 5c 32 36 36 63  6.50 "t1='a\266c
31d0: 27 2c 20 74 32 3d 27 61 3f 63 27 22 20 7b 74 31  ', t2='a?c'" {t1
31e0: 20 47 4c 4f 42 20 74 32 7d 20 31 0a 20 20 20 20   GLOB t2} 1.    
31f0: 74 65 73 74 5f 65 78 70 72 20 65 78 70 72 2d 36  test_expr expr-6
3200: 2e 35 31 20 22 74 31 3d 27 61 5c 32 36 36 27 2c  .51 "t1='a\266',
3210: 20 74 32 3d 27 61 3f 27 22 20 7b 74 31 20 47 4c   t2='a?'" {t1 GL
3220: 4f 42 20 74 32 7d 20 31 0a 20 20 20 20 74 65 73  OB t2} 1.    tes
3230: 74 5f 65 78 70 72 20 65 78 70 72 2d 36 2e 35 32  t_expr expr-6.52
3240: 20 22 74 31 3d 27 61 5c 32 36 36 27 2c 20 74 32   "t1='a\266', t2
3250: 3d 27 61 3f 3f 27 22 20 7b 74 31 20 47 4c 4f 42  ='a??'" {t1 GLOB
3260: 20 74 32 7d 20 30 0a 20 20 20 20 74 65 73 74 5f   t2} 0.    test_
3270: 65 78 70 72 20 65 78 70 72 2d 36 2e 35 33 20 22  expr expr-6.53 "
3280: 74 31 3d 27 61 78 5c 32 36 36 27 2c 20 74 32 3d  t1='ax\266', t2=
3290: 27 61 3f 3f 27 22 20 7b 74 31 20 47 4c 4f 42 20  'a??'" {t1 GLOB 
32a0: 74 32 7d 20 31 0a 20 20 20 20 74 65 73 74 5f 65  t2} 1.    test_e
32b0: 78 70 72 20 65 78 70 72 2d 36 2e 35 34 20 22 74  xpr expr-6.54 "t
32c0: 31 3d 27 61 78 5c 32 36 36 27 2c 20 74 32 3d 27  1='ax\266', t2='
32d0: 61 3f 5c 32 36 36 27 22 20 7b 74 31 20 47 4c 4f  a?\266'" {t1 GLO
32e0: 42 20 74 32 7d 20 31 0a 20 20 20 20 74 65 73 74  B t2} 1.    test
32f0: 5f 65 78 70 72 20 65 78 70 72 2d 36 2e 35 35 20  _expr expr-6.55 
3300: 22 74 31 3d 27 61 78 5c 32 36 36 79 5c 32 36 36  "t1='ax\266y\266
3310: 27 2c 20 74 32 3d 27 61 2a 5c 32 36 36 27 22 20  ', t2='a*\266'" 
3320: 7b 74 31 20 47 4c 4f 42 20 74 32 7d 20 31 0a 20  {t1 GLOB t2} 1. 
3330: 20 20 20 74 65 73 74 5f 65 78 70 72 20 65 78 70     test_expr exp
3340: 72 2d 36 2e 35 36 20 22 74 31 3d 27 61 5c 32 36  r-6.56 "t1='a\26
3350: 36 62 27 2c 20 74 32 3d 27 61 5c 5b 78 5c 32 36  6b', t2='a\[x\26
3360: 36 79 5c 5d 62 27 22 20 7b 74 31 20 47 4c 4f 42  6y\]b'" {t1 GLOB
3370: 20 74 32 7d 20 31 0a 20 20 20 20 74 65 73 74 5f   t2} 1.    test_
3380: 65 78 70 72 20 65 78 70 72 2d 36 2e 35 37 20 22  expr expr-6.57 "
3390: 74 31 3d 27 61 5c 32 36 36 62 27 2c 20 74 32 3d  t1='a\266b', t2=
33a0: 27 61 5c 5b 5c 32 36 30 2d 5c 32 37 30 5c 5d 62  'a\[\260-\270\]b
33b0: 27 22 20 7b 74 31 20 47 4c 4f 42 20 74 32 7d 20  '" {t1 GLOB t2} 
33c0: 31 0a 20 20 20 20 74 65 73 74 5f 65 78 70 72 20  1.    test_expr 
33d0: 65 78 70 72 2d 36 2e 35 38 20 22 74 31 3d 27 61  expr-6.58 "t1='a
33e0: 5c 32 36 36 62 27 2c 20 74 32 3d 27 61 5c 5b 5c  \266b', t2='a\[\
33f0: 32 36 36 2d 5c 32 37 30 5c 5d 62 27 22 20 7b 74  266-\270\]b'" {t
3400: 31 20 47 4c 4f 42 20 74 32 7d 20 31 0a 20 20 20  1 GLOB t2} 1.   
3410: 20 74 65 73 74 5f 65 78 70 72 20 65 78 70 72 2d   test_expr expr-
3420: 36 2e 35 39 20 22 74 31 3d 27 61 5c 32 36 36 62  6.59 "t1='a\266b
3430: 27 2c 20 74 32 3d 27 61 5c 5b 5c 32 36 37 2d 5c  ', t2='a\[\267-\
3440: 32 37 30 5c 5d 62 27 22 20 7b 74 31 20 47 4c 4f  270\]b'" {t1 GLO
3450: 42 20 74 32 7d 20 30 0a 20 20 20 20 74 65 73 74  B t2} 0.    test
3460: 5f 65 78 70 72 20 65 78 70 72 2d 36 2e 36 30 20  _expr expr-6.60 
3470: 22 74 31 3d 27 61 5c 32 36 36 62 27 2c 20 74 32  "t1='a\266b', t2
3480: 3d 27 61 5c 5b 78 2d 5c 32 36 37 5c 5d 62 27 22  ='a\[x-\267\]b'"
3490: 20 7b 74 31 20 47 4c 4f 42 20 74 32 7d 20 31 0a   {t1 GLOB t2} 1.
34a0: 20 20 20 20 74 65 73 74 5f 65 78 70 72 20 65 78      test_expr ex
34b0: 70 72 2d 36 2e 36 31 20 22 74 31 3d 27 61 5c 32  pr-6.61 "t1='a\2
34c0: 36 36 62 27 2c 20 74 32 3d 27 61 5c 5b 78 2d 5c  66b', t2='a\[x-\
34d0: 32 36 36 5c 5d 62 27 22 20 7b 74 31 20 47 4c 4f  266\]b'" {t1 GLO
34e0: 42 20 74 32 7d 20 31 0a 20 20 20 20 74 65 73 74  B t2} 1.    test
34f0: 5f 65 78 70 72 20 65 78 70 72 2d 36 2e 36 32 20  _expr expr-6.62 
3500: 22 74 31 3d 27 61 5c 32 36 36 62 27 2c 20 74 32  "t1='a\266b', t2
3510: 3d 27 61 5c 5b 78 2d 5c 32 36 35 5c 5d 62 27 22  ='a\[x-\265\]b'"
3520: 20 7b 74 31 20 47 4c 4f 42 20 74 32 7d 20 30 0a   {t1 GLOB t2} 0.
3530: 20 20 7d 0a 7d 0a 0a 23 20 54 68 65 20 73 71 6c    }.}..# The sql
3540: 69 74 65 45 78 70 72 49 66 46 61 6c 73 65 20 61  iteExprIfFalse a
3550: 6e 64 20 73 71 6c 69 74 65 45 78 70 72 49 66 54  nd sqliteExprIfT
3560: 72 75 65 20 72 6f 75 74 69 6e 65 73 20 61 72 65  rue routines are
3570: 20 6f 6e 6c 79 0a 23 20 65 78 65 63 75 74 65 64   only.# executed
3580: 20 61 73 20 70 61 72 74 20 6f 66 20 61 20 57 48   as part of a WH
3590: 45 52 45 20 63 6c 61 75 73 65 2e 20 20 43 72 65  ERE clause.  Cre
35a0: 61 74 65 20 61 20 74 61 62 6c 65 20 73 75 69 74  ate a table suit
35b0: 61 62 6c 65 0a 23 20 66 6f 72 20 74 65 73 74 69  able.# for testi
35c0: 6e 67 20 74 68 65 73 65 20 66 75 6e 63 74 69 6f  ng these functio
35d0: 6e 73 2e 0a 23 0a 65 78 65 63 73 71 6c 20 7b 44  ns..#.execsql {D
35e0: 52 4f 50 20 54 41 42 4c 45 20 74 65 73 74 31 7d  ROP TABLE test1}
35f0: 0a 65 78 65 63 73 71 6c 20 7b 43 52 45 41 54 45  .execsql {CREATE
3600: 20 54 41 42 4c 45 20 74 65 73 74 31 28 61 20 69   TABLE test1(a i
3610: 6e 74 2c 20 62 20 69 6e 74 29 3b 7d 0a 66 6f 72  nt, b int);}.for
3620: 20 7b 73 65 74 20 69 20 31 7d 20 7b 24 69 3c 3d   {set i 1} {$i<=
3630: 32 30 7d 20 7b 69 6e 63 72 20 69 7d 20 7b 0a 20  20} {incr i} {. 
3640: 20 65 78 65 63 73 71 6c 20 22 49 4e 53 45 52 54   execsql "INSERT
3650: 20 49 4e 54 4f 20 74 65 73 74 31 20 56 41 4c 55   INTO test1 VALU
3660: 45 53 28 24 69 2c 5b 65 78 70 72 20 7b 69 6e 74  ES($i,[expr {int
3670: 28 70 6f 77 28 32 2c 24 69 29 29 7d 5d 29 22 0a  (pow(2,$i))}])".
3680: 7d 0a 65 78 65 63 73 71 6c 20 22 49 4e 53 45 52  }.execsql "INSER
3690: 54 20 49 4e 54 4f 20 74 65 73 74 31 20 56 41 4c  T INTO test1 VAL
36a0: 55 45 53 28 4e 55 4c 4c 2c 30 29 22 0a 64 6f 5f  UES(NULL,0)".do_
36b0: 74 65 73 74 20 65 78 70 72 2d 37 2e 31 20 7b 0a  test expr-7.1 {.
36c0: 20 20 65 78 65 63 73 71 6c 20 7b 53 45 4c 45 43    execsql {SELEC
36d0: 54 20 2a 20 46 52 4f 4d 20 74 65 73 74 31 20 4f  T * FROM test1 O
36e0: 52 44 45 52 20 42 59 20 61 7d 0a 7d 20 7b 7b 7d  RDER BY a}.} {{}
36f0: 20 30 20 31 20 32 20 32 20 34 20 33 20 38 20 34   0 1 2 2 4 3 8 4
3700: 20 31 36 20 35 20 33 32 20 36 20 36 34 20 37 20   16 5 32 6 64 7 
3710: 31 32 38 20 38 20 32 35 36 20 39 20 35 31 32 20  128 8 256 9 512 
3720: 31 30 20 31 30 32 34 20 31 31 20 32 30 34 38 20  10 1024 11 2048 
3730: 31 32 20 34 30 39 36 20 31 33 20 38 31 39 32 20  12 4096 13 8192 
3740: 31 34 20 31 36 33 38 34 20 31 35 20 33 32 37 36  14 16384 15 3276
3750: 38 20 31 36 20 36 35 35 33 36 20 31 37 20 31 33  8 16 65536 17 13
3760: 31 30 37 32 20 31 38 20 32 36 32 31 34 34 20 31  1072 18 262144 1
3770: 39 20 35 32 34 32 38 38 20 32 30 20 31 30 34 38  9 524288 20 1048
3780: 35 37 36 7d 0a 0a 70 72 6f 63 20 74 65 73 74 5f  576}..proc test_
3790: 65 78 70 72 32 20 7b 6e 61 6d 65 20 65 78 70 72  expr2 {name expr
37a0: 20 72 65 73 75 6c 74 7d 20 7b 0a 20 20 64 6f 5f   result} {.  do_
37b0: 74 65 73 74 20 24 6e 61 6d 65 20 5b 66 6f 72 6d  test $name [form
37c0: 61 74 20 7b 0a 20 20 20 20 65 78 65 63 73 71 6c  at {.    execsql
37d0: 20 7b 53 45 4c 45 43 54 20 61 20 46 52 4f 4d 20   {SELECT a FROM 
37e0: 74 65 73 74 31 20 57 48 45 52 45 20 25 73 20 4f  test1 WHERE %s O
37f0: 52 44 45 52 20 42 59 20 61 7d 0a 20 20 7d 20 24  RDER BY a}.  } $
3800: 65 78 70 72 5d 20 24 72 65 73 75 6c 74 0a 7d 0a  expr] $result.}.
3810: 0a 74 65 73 74 5f 65 78 70 72 32 20 65 78 70 72  .test_expr2 expr
3820: 2d 37 2e 32 20 20 7b 61 3c 31 30 20 41 4e 44 20  -7.2  {a<10 AND 
3830: 61 3e 38 7d 20 20 20 20 20 20 20 20 20 20 20 20  a>8}            
3840: 20 20 20 20 20 20 7b 39 7d 0a 74 65 73 74 5f 65        {9}.test_e
3850: 78 70 72 32 20 65 78 70 72 2d 37 2e 33 20 20 7b  xpr2 expr-7.3  {
3860: 61 3c 3d 31 30 20 41 4e 44 20 61 3e 3d 38 7d 20  a<=10 AND a>=8} 
3870: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b                 {
3880: 38 20 39 20 31 30 7d 0a 74 65 73 74 5f 65 78 70  8 9 10}.test_exp
3890: 72 32 20 65 78 70 72 2d 37 2e 34 20 20 7b 61 3e  r2 expr-7.4  {a>
38a0: 3d 38 20 41 4e 44 20 61 3c 3d 31 30 7d 20 20 20  =8 AND a<=10}   
38b0: 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 38 20               {8 
38c0: 39 20 31 30 7d 0a 74 65 73 74 5f 65 78 70 72 32  9 10}.test_expr2
38d0: 20 65 78 70 72 2d 37 2e 35 20 20 7b 61 3e 3d 32   expr-7.5  {a>=2
38e0: 30 20 4f 52 20 61 3c 3d 31 7d 20 20 20 20 20 20  0 OR a<=1}      
38f0: 20 20 20 20 20 20 20 20 20 20 20 7b 7b 7d 20 31             {{} 1
3900: 20 32 30 7d 0a 74 65 73 74 5f 65 78 70 72 32 20   20}.test_expr2 
3910: 65 78 70 72 2d 37 2e 36 20 20 7b 62 21 3d 34 20  expr-7.6  {b!=4 
3920: 41 4e 44 20 61 3c 3d 33 7d 20 20 20 20 20 20 20  AND a<=3}       
3930: 20 20 20 20 20 20 20 20 20 20 7b 7b 7d 20 31 20            {{} 1 
3940: 33 7d 0a 74 65 73 74 5f 65 78 70 72 32 20 65 78  3}.test_expr2 ex
3950: 70 72 2d 37 2e 37 20 20 7b 62 3d 3d 38 20 4f 52  pr-7.7  {b==8 OR
3960: 20 62 3d 3d 31 36 20 4f 52 20 62 3d 3d 33 32 7d   b==16 OR b==32}
3970: 20 20 20 20 20 20 20 20 7b 33 20 34 20 35 7d 0a          {3 4 5}.
3980: 74 65 73 74 5f 65 78 70 72 32 20 65 78 70 72 2d  test_expr2 expr-
3990: 37 2e 38 20 20 7b 4e 4f 54 20 62 3c 3e 38 20 4f  7.8  {NOT b<>8 O
39a0: 52 20 62 3d 3d 31 30 32 34 7d 20 20 20 20 20 20  R b==1024}      
39b0: 20 20 20 20 20 7b 33 20 31 30 7d 0a 74 65 73 74       {3 10}.test
39c0: 5f 65 78 70 72 32 20 65 78 70 72 2d 37 2e 39 20  _expr2 expr-7.9 
39d0: 20 7b 62 20 4c 49 4b 45 20 27 31 30 25 27 7d 20   {b LIKE '10%'} 
39e0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
39f0: 20 7b 31 30 20 32 30 7d 0a 74 65 73 74 5f 65 78   {10 20}.test_ex
3a00: 70 72 32 20 65 78 70 72 2d 37 2e 31 30 20 7b 62  pr2 expr-7.10 {b
3a10: 20 4c 49 4b 45 20 27 5f 34 27 7d 20 20 20 20 20   LIKE '_4'}     
3a20: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 36                {6
3a30: 7d 0a 74 65 73 74 5f 65 78 70 72 32 20 65 78 70  }.test_expr2 exp
3a40: 72 2d 37 2e 31 31 20 7b 61 20 47 4c 4f 42 20 27  r-7.11 {a GLOB '
3a50: 31 3f 27 7d 20 20 20 20 20 20 20 20 20 20 20 20  1?'}            
3a60: 7b 31 30 20 31 31 20 31 32 20 31 33 20 31 34 20  {10 11 12 13 14 
3a70: 31 35 20 31 36 20 31 37 20 31 38 20 31 39 7d 0a  15 16 17 18 19}.
3a80: 74 65 73 74 5f 65 78 70 72 32 20 65 78 70 72 2d  test_expr2 expr-
3a90: 37 2e 31 32 20 7b 62 20 47 4c 4f 42 20 27 31 2a  7.12 {b GLOB '1*
3aa0: 34 27 7d 20 20 20 20 20 20 20 20 20 20 20 20 20  4'}             
3ab0: 20 20 20 20 20 7b 31 30 20 31 34 7d 0a 74 65 73       {10 14}.tes
3ac0: 74 5f 65 78 70 72 32 20 65 78 70 72 2d 37 2e 31  t_expr2 expr-7.1
3ad0: 33 20 7b 62 20 47 4c 4f 42 20 27 2a 31 5b 34 35  3 {b GLOB '*1[45
3ae0: 36 5d 27 7d 20 20 20 20 20 20 20 20 20 20 20 20  6]'}            
3af0: 20 20 7b 34 7d 0a 74 65 73 74 5f 65 78 70 72 32    {4}.test_expr2
3b00: 20 65 78 70 72 2d 37 2e 31 34 20 7b 61 20 49 53   expr-7.14 {a IS
3b10: 4e 55 4c 4c 7d 20 20 20 20 20 20 20 20 20 20 20  NULL}           
3b20: 20 20 20 20 20 20 20 20 20 20 20 7b 7b 7d 7d 0a             {{}}.
3b30: 74 65 73 74 5f 65 78 70 72 32 20 65 78 70 72 2d  test_expr2 expr-
3b40: 37 2e 31 35 20 7b 61 20 4e 4f 54 4e 55 4c 4c 20  7.15 {a NOTNULL 
3b50: 41 4e 44 20 61 3c 33 7d 20 20 20 20 20 20 20 20  AND a<3}        
3b60: 20 20 20 20 20 7b 31 20 32 7d 0a 74 65 73 74 5f       {1 2}.test_
3b70: 65 78 70 72 32 20 65 78 70 72 2d 37 2e 31 36 20  expr2 expr-7.16 
3b80: 7b 61 20 41 4e 44 20 61 3c 33 7d 20 20 20 20 20  {a AND a<3}     
3b90: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
3ba0: 7b 31 20 32 7d 0a 74 65 73 74 5f 65 78 70 72 32  {1 2}.test_expr2
3bb0: 20 65 78 70 72 2d 37 2e 31 37 20 7b 4e 4f 54 20   expr-7.17 {NOT 
3bc0: 61 7d 20 20 20 20 20 20 20 20 20 20 20 20 20 20  a}              
3bd0: 20 20 20 20 20 20 20 20 20 20 20 7b 7b 7d 7d 0a             {{}}.
3be0: 74 65 73 74 5f 65 78 70 72 32 20 65 78 70 72 2d  test_expr2 expr-
3bf0: 37 2e 31 38 20 7b 61 3d 3d 31 31 20 4f 52 20 28  7.18 {a==11 OR (
3c00: 62 3e 31 30 30 30 20 41 4e 44 20 62 3c 32 30 30  b>1000 AND b<200
3c10: 30 29 7d 20 20 7b 31 30 20 31 31 7d 0a 74 65 73  0)}  {10 11}.tes
3c20: 74 5f 65 78 70 72 32 20 65 78 70 72 2d 37 2e 31  t_expr2 expr-7.1
3c30: 39 20 7b 61 3c 3d 31 20 4f 52 20 61 3e 3d 32 30  9 {a<=1 OR a>=20
3c40: 7d 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20  }               
3c50: 20 20 7b 7b 7d 20 31 20 32 30 7d 0a 74 65 73 74    {{} 1 20}.test
3c60: 5f 65 78 70 72 32 20 65 78 70 72 2d 37 2e 32 30  _expr2 expr-7.20
3c70: 20 7b 61 3c 31 20 4f 52 20 61 3e 32 30 7d 20 20   {a<1 OR a>20}  
3c80: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
3c90: 20 7b 7b 7d 7d 0a 74 65 73 74 5f 65 78 70 72 32   {{}}.test_expr2
3ca0: 20 65 78 70 72 2d 37 2e 32 31 20 7b 61 3e 31 39   expr-7.21 {a>19
3cb0: 20 4f 52 20 61 3c 31 7d 20 20 20 20 20 20 20 20   OR a<1}        
3cc0: 20 20 20 20 20 20 20 20 20 20 20 7b 7b 7d 20 32             {{} 2
3cd0: 30 7d 0a 74 65 73 74 5f 65 78 70 72 32 20 65 78  0}.test_expr2 ex
3ce0: 70 72 2d 37 2e 32 32 20 7b 61 21 3d 31 20 4f 52  pr-7.22 {a!=1 OR
3cf0: 20 61 3d 31 30 30 7d 20 5c 0a 20 20 20 20 20 20   a=100} \.      
3d00: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
3d10: 20 20 20 7b 7b 7d 20 32 20 33 20 34 20 35 20 36     {{} 2 3 4 5 6
3d20: 20 37 20 38 20 39 20 31 30 20 31 31 20 31 32 20   7 8 9 10 11 12 
3d30: 31 33 20 31 34 20 31 35 20 31 36 20 31 37 20 31  13 14 15 16 17 1
3d40: 38 20 31 39 20 32 30 7d 0a 74 65 73 74 5f 65 78  8 19 20}.test_ex
3d50: 70 72 32 20 65 78 70 72 2d 37 2e 32 33 20 7b 28  pr2 expr-7.23 {(
3d60: 61 20 6e 6f 74 6e 75 6c 6c 20 41 4e 44 20 61 3c  a notnull AND a<
3d70: 34 29 20 4f 52 20 61 3d 3d 38 7d 20 20 20 7b 31  4) OR a==8}   {1
3d80: 20 32 20 33 20 38 7d 0a 74 65 73 74 5f 65 78 70   2 3 8}.test_exp
3d90: 72 32 20 65 78 70 72 2d 37 2e 32 34 20 7b 61 20  r2 expr-7.24 {a 
3da0: 4c 49 4b 45 20 27 32 5f 27 20 4f 52 20 61 3d 3d  LIKE '2_' OR a==
3db0: 38 7d 20 20 20 20 20 20 20 20 20 20 20 7b 38 20  8}           {8 
3dc0: 32 30 7d 0a 74 65 73 74 5f 65 78 70 72 32 20 65  20}.test_expr2 e
3dd0: 78 70 72 2d 37 2e 32 35 20 7b 61 20 47 4c 4f 42  xpr-7.25 {a GLOB
3de0: 20 27 32 3f 27 20 4f 52 20 61 3d 3d 38 7d 20 20   '2?' OR a==8}  
3df0: 20 20 20 20 20 20 20 20 20 7b 38 20 32 30 7d 0a           {8 20}.
3e00: 74 65 73 74 5f 65 78 70 72 32 20 65 78 70 72 2d  test_expr2 expr-
3e10: 37 2e 32 36 20 7b 61 20 69 73 6e 75 6c 6c 20 4f  7.26 {a isnull O
3e20: 52 20 61 3d 38 7d 20 20 20 20 20 20 20 20 20 20  R a=8}          
3e30: 20 20 20 20 20 7b 7b 7d 20 38 7d 0a 74 65 73 74       {{} 8}.test
3e40: 5f 65 78 70 72 32 20 65 78 70 72 2d 37 2e 32 37  _expr2 expr-7.27
3e50: 20 7b 61 20 6e 6f 74 6e 75 6c 6c 20 4f 52 20 61   {a notnull OR a
3e60: 3d 38 7d 20 5c 0a 20 20 20 20 20 20 20 20 20 20  =8} \.          
3e70: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
3e80: 7b 31 20 32 20 33 20 34 20 35 20 36 20 37 20 38  {1 2 3 4 5 6 7 8
3e90: 20 39 20 31 30 20 31 31 20 31 32 20 31 33 20 31   9 10 11 12 13 1
3ea0: 34 20 31 35 20 31 36 20 31 37 20 31 38 20 31 39  4 15 16 17 18 19
3eb0: 20 32 30 7d 0a 0a 66 69 6e 69 73 68 5f 74 65 73   20}..finish_tes
3ec0: 74 0a                                            t.