fts3tok_err.test 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. # 2013 April 22
  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
  12. # focus of this script is testing the "fts3tokenize" virtual table
  13. # that is part of the FTS3 module.
  14. #
  15. set testdir [file dirname $argv0]
  16. source $testdir/tester.tcl
  17. source $testdir/malloc_common.tcl
  18. ifcapable !fts3 { finish_test ; return }
  19. set ::testprefix fts3tok_err
  20. faultsim_save_and_close
  21. do_faultsim_test fts3tok_err-1 -faults oom* -prep {
  22. faultsim_restore_and_reopen
  23. } -body {
  24. execsql { CREATE VIRTUAL TABLE t1 USING fts3tokenize("simple"); }
  25. } -test {
  26. faultsim_test_result {0 {}}
  27. }
  28. do_test fts3tok_err-2.prep {
  29. faultsim_delete_and_reopen
  30. execsql { CREATE VIRTUAL TABLE t1 USING fts3tokenize("simple"); }
  31. faultsim_save_and_close
  32. } {}
  33. do_faultsim_test fts3tok_err-2 -faults oom* -prep {
  34. faultsim_restore_and_reopen
  35. } -body {
  36. execsql { SELECT token FROM t1 WHERE input = 'A galaxy far, far away' }
  37. } -test {
  38. faultsim_test_result {0 {a galaxy far far away}}
  39. }
  40. finish_test