os/persistentdata/persistentstorage/sqlite3api/TEST/TclScript/fts1m.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/fts1m.test	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,50 @@
     1.4 +# 2007 July 27
     1.5 +#
     1.6 +# The author disclaims copyright to this source code.  In place of
     1.7 +# a legal notice, here is a blessing:
     1.8 +#
     1.9 +#    May you do good and not evil.
    1.10 +#    May you find forgiveness for yourself and forgive others.
    1.11 +#    May you share freely, never taking more than you give.
    1.12 +#
    1.13 +#*************************************************************************
    1.14 +# This file implements regression tests for SQLite library.  The focus
    1.15 +# of this script is testing the FTS1 module, specifically snippet
    1.16 +# generation.  Extracted from fts2o.test.
    1.17 +#
    1.18 +# $Id: fts1m.test,v 1.1 2007/07/25 00:25:20 shess Exp $
    1.19 +#
    1.20 +
    1.21 +set testdir [file dirname $argv0]
    1.22 +source $testdir/tester.tcl
    1.23 +
    1.24 +# If SQLITE_ENABLE_FTS1 is not defined, omit this file.
    1.25 +ifcapable !fts1 {
    1.26 +  finish_test
    1.27 +  return
    1.28 +}
    1.29 +
    1.30 +#---------------------------------------------------------------------
    1.31 +# These tests, fts1m-1.*, test that ticket #2429 is fixed.
    1.32 +#
    1.33 +db eval {
    1.34 +  CREATE VIRTUAL TABLE t1 USING fts1(a, b, c);
    1.35 +  INSERT INTO t1(a, b, c) VALUES('one three four', 'one four', 'one four two');
    1.36 +}
    1.37 +do_test fts1m-1.1 {
    1.38 +  execsql {
    1.39 +    SELECT rowid, snippet(t1) FROM t1 WHERE c MATCH 'four';
    1.40 +  }
    1.41 +} {1 {one <b>four</b> two}}
    1.42 +do_test fts1m-1.2 {
    1.43 +  execsql {
    1.44 +    SELECT rowid, snippet(t1) FROM t1 WHERE b MATCH 'four';
    1.45 +  }
    1.46 +} {1 {one <b>four</b>}}
    1.47 +do_test fts1m-1.3 {
    1.48 +  execsql {
    1.49 +    SELECT rowid, snippet(t1) FROM t1 WHERE a MATCH 'four';
    1.50 +  }
    1.51 +} {1 {one three <b>four</b>}}
    1.52 +
    1.53 +finish_test