3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing:
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.
10 #*************************************************************************
11 # This file implements regression tests for SQLite library. The
12 # focus of this script is testing the FTS5 module.
15 source [file join [file dirname [info script]] fts5_common.tcl]
16 set testprefix fts5interrupt
18 # If SQLITE_ENABLE_FTS5 is not defined, omit this file.
25 CREATE VIRTUAL TABLE t1 USING fts5(a);
26 INSERT INTO t1(t1, rank) VALUES('pgsz', 40);
30 proc progress_handler {args} {
31 incr ::progress_handler_delay -1
32 if {$::progress_handler_delay<=0} { return 1 }
37 1 { INSERT INTO t1(rowid, a) VALUES(0, 'z z z z') }
41 for {set i 1} {$bDone==0} {incr i} {
46 INSERT INTO t1(rowid, a) VALUES(1, 'a b c d');
47 INSERT INTO t1(rowid, a) VALUES(2, 'd e f g');
48 INSERT INTO t1(rowid, a) VALUES(3, 'h i j k');
49 INSERT INTO t1(rowid, a) VALUES(4, 'l m n o');
52 set ::progress_handler_delay $i
53 db progress 1 progress_handler
54 set res [catchsql $sql]
59 if {$res!="1 interrupted"} { error "got: $res" }