os/persistentdata/persistentstorage/sqlite3api/TEST/TclScript/fts3am.test
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/persistentdata/persistentstorage/sqlite3api/TEST/TclScript/fts3am.test	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,65 @@
     1.4 +# 2007 April 9
     1.5 +#
     1.6 +# The author disclaims copyright to this source code.
     1.7 +#
     1.8 +#*************************************************************************
     1.9 +# This file implements regression tests for SQLite library.  fts3
    1.10 +# DELETE handling assumed all fields were non-null.  This was not
    1.11 +# the intention at all.
    1.12 +#
    1.13 +# $Id: fts3am.test,v 1.1 2007/08/20 17:38:42 shess Exp $
    1.14 +#
    1.15 +
    1.16 +set testdir [file dirname $argv0]
    1.17 +source $testdir/tester.tcl
    1.18 +
    1.19 +# If SQLITE_ENABLE_FTS3 is defined, omit this file.
    1.20 +ifcapable !fts3 {
    1.21 +  finish_test
    1.22 +  return
    1.23 +}
    1.24 +
    1.25 +db eval {
    1.26 +  CREATE VIRTUAL TABLE t1 USING fts3(col_a, col_b);
    1.27 +
    1.28 +  INSERT INTO t1(rowid, col_a, col_b) VALUES(1, 'testing', 'testing');
    1.29 +  INSERT INTO t1(rowid, col_a, col_b) VALUES(2, 'only a', null);
    1.30 +  INSERT INTO t1(rowid, col_a, col_b) VALUES(3, null, 'only b');
    1.31 +  INSERT INTO t1(rowid, col_a, col_b) VALUES(4, null, null);
    1.32 +}
    1.33 +
    1.34 +do_test fts3am-1.0 {
    1.35 +  execsql {
    1.36 +    SELECT COUNT(col_a), COUNT(col_b), COUNT(*) FROM t1;
    1.37 +  }
    1.38 +} {2 2 4}
    1.39 +
    1.40 +do_test fts3am-1.1 {
    1.41 +  execsql {
    1.42 +    DELETE FROM t1 WHERE rowid = 1;
    1.43 +    SELECT COUNT(col_a), COUNT(col_b), COUNT(*) FROM t1;
    1.44 +  }
    1.45 +} {1 1 3}
    1.46 +
    1.47 +do_test fts3am-1.2 {
    1.48 +  execsql {
    1.49 +    DELETE FROM t1 WHERE rowid = 2;
    1.50 +    SELECT COUNT(col_a), COUNT(col_b), COUNT(*) FROM t1;
    1.51 +  }
    1.52 +} {0 1 2}
    1.53 +
    1.54 +do_test fts3am-1.3 {
    1.55 +  execsql {
    1.56 +    DELETE FROM t1 WHERE rowid = 3;
    1.57 +    SELECT COUNT(col_a), COUNT(col_b), COUNT(*) FROM t1;
    1.58 +  }
    1.59 +} {0 0 1}
    1.60 +
    1.61 +do_test fts3am-1.4 {
    1.62 +  execsql {
    1.63 +    DELETE FROM t1 WHERE rowid = 4;
    1.64 +    SELECT COUNT(col_a), COUNT(col_b), COUNT(*) FROM t1;
    1.65 +  }
    1.66 +} {0 0 0}
    1.67 +
    1.68 +finish_test