/ 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 Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/vtab1.test.

  1307   1307     INSERT INTO t6 VALUES(3, '8James');
  1308   1308     INSERT INTO t6 VALUES(4, '8John');
  1309   1309     INSERT INTO t6 VALUES(5, 'Phillip');
  1310   1310     INSERT INTO t6 VALUES(6, 'Bartholomew');
  1311   1311     CREATE VIRTUAL TABLE e6 USING echo(t6);
  1312   1312   }
  1313   1313   
  1314         -foreach {tn sql res filter} {
  1315         -  1.1 "SELECT a FROM e6 WHERE b>'8James'" {4 2 6 1 5}
  1316         -    {xFilter {SELECT rowid, a, b FROM 't6' WHERE b > ?} 8James}
  1317         -
  1318         -  1.2 "SELECT a FROM e6 WHERE b>='8' AND b<'9'" {3 4}
  1319         -    {xFilter {SELECT rowid, a, b FROM 't6' WHERE b >= ? AND b < ?} 8 9}
  1320         -
  1321         -  1.3 "SELECT a FROM e6 WHERE b LIKE '8J%'" {3 4}
  1322         -    {xFilter {SELECT rowid, a, b FROM 't6' WHERE b >= ? AND b < ? AND b like ?} 8J 8k 8J%}
  1323         -
  1324         -  1.4 "SELECT a FROM e6 WHERE b LIKE '8j%'" {3 4}
  1325         -    {xFilter {SELECT rowid, a, b FROM 't6' WHERE b >= ? AND b < ? AND b like ?} 8J 8k 8j%}
  1326         -
  1327         -  1.5 "SELECT a FROM e6 WHERE b LIKE '8%'" {3 4}
  1328         -    {xFilter {SELECT rowid, a, b FROM 't6' WHERE b like ?} 8%}
  1329         -} {
  1330         -  set echo_module {}
  1331         -  do_execsql_test 18.$tn.1 $sql $res
  1332         -  do_test         18.$tn.2 { lrange $::echo_module 2 end } $filter
         1314  +ifcapable !icu {
         1315  +  foreach {tn sql res filter} {
         1316  +    1.1 "SELECT a FROM e6 WHERE b>'8James'" {4 2 6 1 5}
         1317  +      {xFilter {SELECT rowid, a, b FROM 't6' WHERE b > ?} 8James}
         1318  +  
         1319  +    1.2 "SELECT a FROM e6 WHERE b>='8' AND b<'9'" {3 4}
         1320  +      {xFilter {SELECT rowid, a, b FROM 't6' WHERE b >= ? AND b < ?} 8 9}
         1321  +  
         1322  +    1.3 "SELECT a FROM e6 WHERE b LIKE '8J%'" {3 4}
         1323  +      {xFilter {SELECT rowid, a, b FROM 't6' WHERE b >= ? AND b < ? AND b like ?} 8J 8k 8J%}
         1324  +  
         1325  +    1.4 "SELECT a FROM e6 WHERE b LIKE '8j%'" {3 4}
         1326  +      {xFilter {SELECT rowid, a, b FROM 't6' WHERE b >= ? AND b < ? AND b like ?} 8J 8k 8j%}
         1327  +  
         1328  +    1.5 "SELECT a FROM e6 WHERE b LIKE '8%'" {3 4}
         1329  +      {xFilter {SELECT rowid, a, b FROM 't6' WHERE b like ?} 8%}
         1330  +  } {
         1331  +    set echo_module {}
         1332  +    do_execsql_test 18.$tn.1 $sql $res
         1333  +    do_test         18.$tn.2 { lrange $::echo_module 2 end } $filter
         1334  +  }
  1333   1335   }
  1334   1336   
  1335   1337   do_execsql_test 18.2.0 {  PRAGMA case_sensitive_like = ON }
  1336   1338   foreach {tn sql res filter} {
  1337   1339     2.1 "SELECT a FROM e6 WHERE b LIKE '8%'" {3 4}
  1338   1340       {xFilter {SELECT rowid, a, b FROM 't6' WHERE b like ?} 8%}
  1339   1341   

Changes to test/vtabH.test.

    26     26   
    27     27   do_execsql_test 1.0 {
    28     28     CREATE TABLE t6(a, b TEXT);
    29     29     CREATE INDEX i6 ON t6(b, a);
    30     30     CREATE VIRTUAL TABLE e6 USING echo(t6);
    31     31   }
    32     32   
    33         -foreach {tn sql expect} {
    34         -  1 "SELECT * FROM e6 WHERE b LIKE '8abc'" {
    35         -    xBestIndex 
    36         -       {SELECT rowid, a, b FROM 't6' WHERE b >= ? AND b < ? AND b like ?}
    37         -    xFilter
    38         -       {SELECT rowid, a, b FROM 't6' WHERE b >= ? AND b < ? AND b like ?}
    39         -       8ABC 8abd 8abc
    40         -  }
    41         -
    42         -  2 "SELECT * FROM e6 WHERE b GLOB '8abc'" {
    43         -     xBestIndex
    44         -       {SELECT rowid, a, b FROM 't6' WHERE b >= ? AND b < ? AND b glob ?}
    45         -     xFilter
    46         -       {SELECT rowid, a, b FROM 't6' WHERE b >= ? AND b < ? AND b glob ?}
    47         -       8abc 8abd 8abc
    48         -  }
    49         -  3 "SELECT * FROM e6 WHERE b LIKE '8e/'" {
    50         -    xBestIndex {SELECT rowid, a, b FROM 't6' WHERE b like ?}
    51         -    xFilter {SELECT rowid, a, b FROM 't6' WHERE b like ?} 8e/
    52         -  }
    53         -  4 "SELECT * FROM e6 WHERE b GLOB '8e/'" {
    54         -    xBestIndex {SELECT rowid, a, b FROM 't6' WHERE b glob ?}
    55         -    xFilter {SELECT rowid, a, b FROM 't6' WHERE b glob ?} 8e/
    56         -  }
    57         -} {
    58         -  do_test 1.$tn {
    59         -    set echo_module {}
    60         -    execsql $sql
    61         -    set ::echo_module
    62         -  } [list {*}$expect]
           33  +ifcapable !icu {
           34  +  foreach {tn sql expect} {
           35  +    1 "SELECT * FROM e6 WHERE b LIKE '8abc'" {
           36  +      xBestIndex 
           37  +         {SELECT rowid, a, b FROM 't6' WHERE b >= ? AND b < ? AND b like ?}
           38  +      xFilter
           39  +         {SELECT rowid, a, b FROM 't6' WHERE b >= ? AND b < ? AND b like ?}
           40  +         8ABC 8abd 8abc
           41  +    }
           42  +  
           43  +    2 "SELECT * FROM e6 WHERE b GLOB '8abc'" {
           44  +       xBestIndex
           45  +         {SELECT rowid, a, b FROM 't6' WHERE b >= ? AND b < ? AND b glob ?}
           46  +       xFilter
           47  +         {SELECT rowid, a, b FROM 't6' WHERE b >= ? AND b < ? AND b glob ?}
           48  +         8abc 8abd 8abc
           49  +    }
           50  +    3 "SELECT * FROM e6 WHERE b LIKE '8e/'" {
           51  +      xBestIndex {SELECT rowid, a, b FROM 't6' WHERE b like ?}
           52  +      xFilter {SELECT rowid, a, b FROM 't6' WHERE b like ?} 8e/
           53  +    }
           54  +    4 "SELECT * FROM e6 WHERE b GLOB '8e/'" {
           55  +      xBestIndex {SELECT rowid, a, b FROM 't6' WHERE b glob ?}
           56  +      xFilter {SELECT rowid, a, b FROM 't6' WHERE b glob ?} 8e/
           57  +    }
           58  +  } {
           59  +    do_test 1.$tn {
           60  +      set echo_module {}
           61  +      execsql $sql
           62  +      set ::echo_module
           63  +    } [list {*}$expect]
           64  +  }
    63     65   }
    64     66   
    65     67   
    66     68   #--------------------------------------------------------------------------
    67     69   
    68     70   register_tclvar_module db
    69     71   set ::xyz 10