Testrunner.tcl enhancements: (1) Attempt to build the SQLite tcl extension
[sqlite.git] / test / fts4min.test
blobca63b3961716c7fa97cfda72d819b9af55ebbeeb
1 # 2020 February 27
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 #*************************************************************************
13 set testdir [file dirname $argv0]
14 source $testdir/tester.tcl
15 source $testdir/fts3_common.tcl
16 set ::testprefix fts4min
18 # If SQLITE_ENABLE_FTS3 is defined, omit this file.
19 ifcapable !fts3 {
20   finish_test
21   return
24 #------------------------------------------------------------------
25 do_execsql_test 0.0 {
26   CREATE TABLE t1(a NOT NULL, b);
27   CREATE INDEX i1 ON t1(a);
30 do_execsql_test 1.0 {
31   CREATE VIRTUAL TABLE ft USING fts3(c);
32   INSERT INTO ft(docid, c) VALUES(22, 'hello world');
33   INSERT INTO ft(docid, c) VALUES(44, 'hello world');
34   INSERT INTO ft(docid, c) VALUES(11, 'hello world');
37 do_eqp_test 1.1.1 {
38   SELECT max(rowid) FROM ft
39 } {VIRTUAL TABLE INDEX 0:DESC}
41 do_eqp_test 1.1.2 {
42   SELECT min(rowid) FROM ft
43 } {VIRTUAL TABLE INDEX 0:ASC}
45 do_execsql_test 1.2.1 {
46   SELECT max(rowid) FROM ft
47 } {44}
49 do_execsql_test 1.2.2 {
50   SELECT min(rowid) FROM ft
51 } {11}
53 finish_test