/ Check-in [408144a1]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Update test cases so that they work with ICU enabled.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 408144a1832569ced8e04840f0dd36a3867405f36b13631b0f13c0f7b8a0fb01
User & Date: dan 2019-08-13 17:56:56
Context
2019-08-13
20:34
Add some static to the 'regexp' extension. check-in: a21d1dde user: mistachkin tags: trunk
17:56
Update test cases so that they work with ICU enabled. check-in: 408144a1 user: dan tags: trunk
17:27
Update some corruption test cases to take [724f4df9c] into account. check-in: 927cd7b4 user: dan tags: trunk
Changes
Hide Diffs Unified Diffs Show Whitespace Changes Patch

Changes to test/vtab1.test.

1307
1308
1309
1310
1311
1312
1313

1314
1315
1316
1317
1318
1319
1320
....
1327
1328
1329
1330
1331
1332
1333

1334
1335
1336
1337
1338
1339
1340
  INSERT INTO t6 VALUES(3, '8James');
  INSERT INTO t6 VALUES(4, '8John');
  INSERT INTO t6 VALUES(5, 'Phillip');
  INSERT INTO t6 VALUES(6, 'Bartholomew');
  CREATE VIRTUAL TABLE e6 USING echo(t6);
}


foreach {tn sql res filter} {
  1.1 "SELECT a FROM e6 WHERE b>'8James'" {4 2 6 1 5}
    {xFilter {SELECT rowid, a, b FROM 't6' WHERE b > ?} 8James}

  1.2 "SELECT a FROM e6 WHERE b>='8' AND b<'9'" {3 4}
    {xFilter {SELECT rowid, a, b FROM 't6' WHERE b >= ? AND b < ?} 8 9}

................................................................................
  1.5 "SELECT a FROM e6 WHERE b LIKE '8%'" {3 4}
    {xFilter {SELECT rowid, a, b FROM 't6' WHERE b like ?} 8%}
} {
  set echo_module {}
  do_execsql_test 18.$tn.1 $sql $res
  do_test         18.$tn.2 { lrange $::echo_module 2 end } $filter
}


do_execsql_test 18.2.0 {  PRAGMA case_sensitive_like = ON }
foreach {tn sql res filter} {
  2.1 "SELECT a FROM e6 WHERE b LIKE '8%'" {3 4}
    {xFilter {SELECT rowid, a, b FROM 't6' WHERE b like ?} 8%}

  2.2 "SELECT a FROM e6 WHERE b LIKE '8j%'" {}







>







 







>







1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
....
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
  INSERT INTO t6 VALUES(3, '8James');
  INSERT INTO t6 VALUES(4, '8John');
  INSERT INTO t6 VALUES(5, 'Phillip');
  INSERT INTO t6 VALUES(6, 'Bartholomew');
  CREATE VIRTUAL TABLE e6 USING echo(t6);
}

ifcapable !icu {
  foreach {tn sql res filter} {
    1.1 "SELECT a FROM e6 WHERE b>'8James'" {4 2 6 1 5}
      {xFilter {SELECT rowid, a, b FROM 't6' WHERE b > ?} 8James}
  
    1.2 "SELECT a FROM e6 WHERE b>='8' AND b<'9'" {3 4}
      {xFilter {SELECT rowid, a, b FROM 't6' WHERE b >= ? AND b < ?} 8 9}
  
................................................................................
    1.5 "SELECT a FROM e6 WHERE b LIKE '8%'" {3 4}
      {xFilter {SELECT rowid, a, b FROM 't6' WHERE b like ?} 8%}
  } {
    set echo_module {}
    do_execsql_test 18.$tn.1 $sql $res
    do_test         18.$tn.2 { lrange $::echo_module 2 end } $filter
  }
}

do_execsql_test 18.2.0 {  PRAGMA case_sensitive_like = ON }
foreach {tn sql res filter} {
  2.1 "SELECT a FROM e6 WHERE b LIKE '8%'" {3 4}
    {xFilter {SELECT rowid, a, b FROM 't6' WHERE b like ?} 8%}

  2.2 "SELECT a FROM e6 WHERE b LIKE '8j%'" {}

Changes to test/vtabH.test.

26
27
28
29
30
31
32

33
34
35
36
37
38
39
..
57
58
59
60
61
62
63

64
65
66
67
68
69
70

do_execsql_test 1.0 {
  CREATE TABLE t6(a, b TEXT);
  CREATE INDEX i6 ON t6(b, a);
  CREATE VIRTUAL TABLE e6 USING echo(t6);
}


foreach {tn sql expect} {
  1 "SELECT * FROM e6 WHERE b LIKE '8abc'" {
    xBestIndex 
       {SELECT rowid, a, b FROM 't6' WHERE b >= ? AND b < ? AND b like ?}
    xFilter
       {SELECT rowid, a, b FROM 't6' WHERE b >= ? AND b < ? AND b like ?}
       8ABC 8abd 8abc
................................................................................
} {
  do_test 1.$tn {
    set echo_module {}
    execsql $sql
    set ::echo_module
  } [list {*}$expect]
}



#--------------------------------------------------------------------------

register_tclvar_module db
set ::xyz 10
do_execsql_test 2.0 {







>







 







>







26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
..
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72

do_execsql_test 1.0 {
  CREATE TABLE t6(a, b TEXT);
  CREATE INDEX i6 ON t6(b, a);
  CREATE VIRTUAL TABLE e6 USING echo(t6);
}

ifcapable !icu {
  foreach {tn sql expect} {
    1 "SELECT * FROM e6 WHERE b LIKE '8abc'" {
      xBestIndex 
         {SELECT rowid, a, b FROM 't6' WHERE b >= ? AND b < ? AND b like ?}
      xFilter
         {SELECT rowid, a, b FROM 't6' WHERE b >= ? AND b < ? AND b like ?}
         8ABC 8abd 8abc
................................................................................
  } {
    do_test 1.$tn {
      set echo_module {}
      execsql $sql
      set ::echo_module
    } [list {*}$expect]
  }
}


#--------------------------------------------------------------------------

register_tclvar_module db
set ::xyz 10
do_execsql_test 2.0 {