CoolFace
Modelpublic

AryaWu/sqlite

sourceHugging Faceupdated 9mo agoView on Hugging Face
0likes
fts4merge5.test62 linesDownload Raw Back to test
1# 2019 October 022#3# The author disclaims copyright to this source code.  In place of4# 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.  The12# focus of this script is testing the FTS4 module.13#14 15set testdir [file dirname $argv0]16source $testdir/tester.tcl17set testprefix fts4merge518 19# If SQLITE_ENABLE_FTS3 is defined, omit this file.20ifcapable !fts3 {21  finish_test22  return23}24 25source $testdir/genesis.tcl26 27do_execsql_test 1.1 { 28  CREATE TABLE t1(docid, words);29}30fts_kjv_genesis31 32do_execsql_test 1.2 {33  CREATE VIRTUAL TABLE x1 USING fts3; 34  INSERT INTO x1(x1) VALUES('nodesize=64');35  INSERT INTO x1(x1) VALUES('maxpending=64');36}37 38do_execsql_test 1.3 {39  INSERT INTO x1(docid, content) SELECT * FROM t1;40}41 42for {set tn 1} {1} {incr tn} {43  set tc1 [db total_changes]44  do_execsql_test 1.4.$tn.1 {45    INSERT INTO x1(x1) VALUES('merge=1,2');46  }47  set tc2 [db total_changes]48 49  if {($tc2 - $tc1)<2} break50 51  do_execsql_test 1.4.$tn.1 {52    INSERT INTO x1(x1) VALUES('integrity-check');53  }54}55 56do_catchsql_test 1.5 {57  INSERT INTO x1(x1) VALUES('maxpendinAB64');58} {1 {SQL logic error}}59 60 61finish_test62