summaryrefslogtreecommitdiffstats
path: root/ext/fts5/test/fts5tok2.test
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-05 17:28:19 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-05 17:28:19 +0000
commit18657a960e125336f704ea058e25c27bd3900dcb (patch)
tree17b438b680ed45a996d7b59951e6aa34023783f2 /ext/fts5/test/fts5tok2.test
parentInitial commit. (diff)
downloadsqlite3-18657a960e125336f704ea058e25c27bd3900dcb.tar.xz
sqlite3-18657a960e125336f704ea058e25c27bd3900dcb.zip
Adding upstream version 3.40.1.upstream/3.40.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'ext/fts5/test/fts5tok2.test')
-rw-r--r--ext/fts5/test/fts5tok2.test47
1 files changed, 47 insertions, 0 deletions
diff --git a/ext/fts5/test/fts5tok2.test b/ext/fts5/test/fts5tok2.test
new file mode 100644
index 0000000..77c7e1e
--- /dev/null
+++ b/ext/fts5/test/fts5tok2.test
@@ -0,0 +1,47 @@
+# 2016 Jan 15
+#
+# The author disclaims copyright to this source code. In place of
+# a legal notice, here is a blessing:
+#
+# May you do good and not evil.
+# May you find forgiveness for yourself and forgive others.
+# May you share freely, never taking more than you give.
+#
+#*************************************************************************
+#
+
+source [file join [file dirname [info script]] fts5_common.tcl]
+ifcapable !fts5||!fts3 { finish_test ; return }
+set ::testprefix fts5tok2
+
+sqlite3_fts5_register_fts5tokenize db
+
+#-------------------------------------------------------------------------
+# Simple test cases. Using the default (ascii) tokenizer.
+#
+do_execsql_test 1.0 {
+ CREATE VIRTUAL TABLE t5 USING fts5tokenize(unicode61);
+ CREATE VIRTUAL TABLE t3 USING fts3tokenize(unicode61);
+}
+
+do_test 1.1 {
+ array unset -nocomplain A
+
+ for {set i 1} {$i < 65536} {incr i} {
+ set input [format "abc%cxyz" $i]
+ set expect [execsql {
+ SELECT input, token, start, end FROM t3 WHERE input=$input
+ }]
+
+ incr A([llength $expect])
+
+ set res [execsql {
+ SELECT input, token, start, end FROM t5($input)
+ }]
+ if {$res != $expect} {error "failed at i=$i"}
+ }
+} {}
+
+do_test 1.1.nTokenChars=$A(4).nSeparators=$A(8) {} {}
+
+finish_test