fts1n.test 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. # 2007 July 24
  2. #
  3. # The author disclaims copyright to this source code. In place of
  4. # a legal notice, here is a blessing:
  5. #
  6. # May you do good and not evil.
  7. # May you find forgiveness for yourself and forgive others.
  8. # May you share freely, never taking more than you give.
  9. #
  10. #*************************************************************************
  11. # This file implements regression tests for SQLite library. The focus
  12. # of this script is testing the FTS1 module for errors in the handling
  13. # of SQLITE_SCHEMA.
  14. #
  15. # $Id: fts1n.test,v 1.1 2007/07/25 00:38:06 shess Exp $
  16. #
  17. set testdir [file dirname $argv0]
  18. source $testdir/tester.tcl
  19. # If SQLITE_ENABLE_FTS1 is not defined, omit this file.
  20. ifcapable !fts1 {
  21. finish_test
  22. return
  23. }
  24. do_test fts1m-1.1 {
  25. execsql {
  26. CREATE VIRTUAL TABLE t1 USING fts1(a, b, c);
  27. INSERT INTO t1(a, b, c) VALUES('one three four', 'one four', 'one two');
  28. SELECT a, b, c FROM t1 WHERE c MATCH 'two';
  29. }
  30. } {{one three four} {one four} {one two}}
  31. # This test was crashing at one point.
  32. #
  33. do_test fts1m-1.2 {
  34. execsql {
  35. SELECT a, b, c FROM t1 WHERE c MATCH 'two';
  36. CREATE TABLE t3(a, b, c);
  37. SELECT a, b, c FROM t1 WHERE c MATCH 'two';
  38. }
  39. } {{one three four} {one four} {one two} {one three four} {one four} {one two}}
  40. finish_test