Index: ext/fts5/test/fts5rank.test ================================================================== --- ext/fts5/test/fts5rank.test +++ ext/fts5/test/fts5rank.test @@ -98,32 +98,57 @@ # # if there were zero occurrences of token 'y' in the dataset. The # following tests verify that that problem has been addressed. # foreach_detail_mode $::testprefix { - do_execsql_test 3.0 { + do_execsql_test 3.1.0 { CREATE VIRTUAL TABLE y1 USING fts5(z, detail=%DETAIL%); INSERT INTO y1 VALUES('test xyz'); INSERT INTO y1 VALUES('test test xyz test'); INSERT INTO y1 VALUES('test test xyz'); } - do_execsql_test 3.1 { + do_execsql_test 3.1.1 { SELECT rowid FROM y1('test OR tset'); } {1 2 3} - do_execsql_test 3.2 { + do_execsql_test 3.1.2 { SELECT rowid FROM y1('test OR tset') ORDER BY bm25(y1) } {2 3 1} - do_execsql_test 3.3 { + do_execsql_test 3.1.3 { SELECT rowid FROM y1('test OR tset') ORDER BY +rank } {2 3 1} - do_execsql_test 3.4 { + do_execsql_test 3.1.4 { SELECT rowid FROM y1('test OR tset') ORDER BY rank } {2 3 1} + + do_execsql_test 3.1.5 { + SELECT rowid FROM y1('test OR xyz') ORDER BY rank + } {3 2 1} + + + do_execsql_test 3.2.1 { + CREATE VIRTUAL TABLE z1 USING fts5(a, detail=%DETAIL%); + INSERT INTO z1 VALUES('wrinkle in time'); + SELECT * FROM z1 WHERE z1 MATCH 'wrinkle in time OR a wrinkle in time'; + } {{wrinkle in time}} } + +do_execsql_test 4.1 { + DROP TABLE IF EXISTS VTest; + CREATE virtual TABLE VTest USING FTS5( + Title, AUthor, tokenize ='porter unicode61 remove_diacritics 1', + columnsize='1', detail=full + ); + INSERT INTO VTest (Title, Author) VALUES ('wrinkle in time', 'Bill Smith'); + + SELECT * FROM VTest WHERE + VTest MATCH 'wrinkle in time OR a wrinkle in time' ORDER BY rank; +} {{wrinkle in time} {Bill Smith}} + + finish_test