~ubuntu-branches/ubuntu/precise/sqlite3/precise-updates

« back to all changes in this revision

Viewing changes to test/fts3expr.test

  • Committer: Bazaar Package Importer
  • Author(s): Laszlo Boszormenyi (GCS)
  • Date: 2009-12-11 14:34:09 UTC
  • mfrom: (9.1.7 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091211143409-o29fahwmcmyd0vq1
Tags: 3.6.21-2
Run autoreconf to prevent FTBFS with new libtool (closes: #560660).

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
# This file implements regression tests for SQLite library.  The
12
12
# focus of this script is testing the FTS3 module.
13
13
#
14
 
# $Id: fts3expr.test,v 1.7 2009/03/12 15:43:48 danielk1977 Exp $
 
14
# $Id: fts3expr.test,v 1.9 2009/07/28 16:44:26 danielk1977 Exp $
15
15
#
16
16
 
17
17
set testdir [file dirname $argv0]
122
122
do_test fts3expr-1.14 {
123
123
  test_fts3expr {a:one two}
124
124
} {AND {PHRASE 0 0 one} {PHRASE 3 0 two}}
125
 
do_test fts3expr-1.15 {
 
125
do_test fts3expr-1.15.1 {
126
126
  test_fts3expr {one b:two}
127
127
} {AND {PHRASE 3 0 one} {PHRASE 1 0 two}}
 
128
do_test fts3expr-1.15.2 {
 
129
  test_fts3expr {one B:two}
 
130
} {AND {PHRASE 3 0 one} {PHRASE 1 0 two}}
128
131
 
129
132
do_test fts3expr-1.16 {
130
133
  test_fts3expr {one AND two AND three AND four AND five}
463
466
  13 "((((((one two OR four five)))))) NOT three" {3 11 19 24 25 26 27}
464
467
 
465
468
} {
466
 
  do_test fts3expr-6.$id {
467
 
    execsql { SELECT rowid FROM t1 WHERE t1 MATCH $expr ORDER BY rowid }
468
 
  } $res
469
 
}
 
469
  do_test fts3expr-6.1.$id {
 
470
    execsql { SELECT rowid FROM t1 WHERE t1 MATCH $expr ORDER BY rowid }
 
471
  } $res
 
472
}
 
473
 
 
474
set sqlite_fts3_enable_parentheses 0
 
475
foreach {id expr res} {
 
476
  1 "one -two three"  {5 13 21 29}
 
477
  2 "-two one three"  {5 13 21 29}
 
478
  3 "one three -two"  {5 13 21 29}
 
479
  4 "-one -two three" {4 12 20 28}
 
480
  5 "three -one -two" {4 12 20 28}
 
481
  6 "-one three -two" {4 12 20 28}
 
482
} {
 
483
  do_test fts3expr-6.2.$id {
 
484
    execsql { SELECT rowid FROM t1 WHERE t1 MATCH $expr ORDER BY rowid }
 
485
  } $res
 
486
}
 
487
set sqlite_fts3_enable_parentheses 1
470
488
 
471
489
do_test fts3expr-7.1 {
472
490
  execsql {
476
494
  }
477
495
} {}
478
496
 
 
497
 
479
498
set sqlite_fts3_enable_parentheses 0
480
499
finish_test