From e36d23a85ebff914d74bb541558c2b6082b78edb Mon Sep 17 00:00:00 2001
From: dan miller
Date: Sat, 20 Oct 2007 02:49:29 +0000
Subject: sqlite source (unix build) added to libraries
---
libraries/sqlite/unix/sqlite-3.5.1/test/fts2d.test | 65 ++++++++++++++++++++++
1 file changed, 65 insertions(+)
create mode 100644 libraries/sqlite/unix/sqlite-3.5.1/test/fts2d.test
(limited to 'libraries/sqlite/unix/sqlite-3.5.1/test/fts2d.test')
diff --git a/libraries/sqlite/unix/sqlite-3.5.1/test/fts2d.test b/libraries/sqlite/unix/sqlite-3.5.1/test/fts2d.test
new file mode 100644
index 0000000..d8090d8
--- /dev/null
+++ b/libraries/sqlite/unix/sqlite-3.5.1/test/fts2d.test
@@ -0,0 +1,65 @@
+# 2006 October 1
+#
+# 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.
+#
+#*************************************************************************
+# This file implements regression tests for SQLite library. The
+# focus of this script is testing the FTS2 module, and in particular
+# the Porter stemmer.
+#
+# $Id: fts2d.test,v 1.1 2006/10/19 23:36:26 shess Exp $
+#
+
+set testdir [file dirname $argv0]
+source $testdir/tester.tcl
+
+# If SQLITE_ENABLE_FTS2 is defined, omit this file.
+ifcapable !fts2 {
+ finish_test
+ return
+}
+
+do_test fts2d-1.1 {
+ execsql {
+ CREATE VIRTUAL TABLE t1 USING fts2(content, tokenize porter);
+ INSERT INTO t1(rowid, content) VALUES(1, 'running and jumping');
+ SELECT rowid FROM t1 WHERE content MATCH 'run jump';
+ }
+} {1}
+do_test fts2d-1.2 {
+ execsql {
+ SELECT snippet(t1) FROM t1 WHERE t1 MATCH 'run jump';
+ }
+} {{running and jumping}}
+do_test fts2d-1.3 {
+ execsql {
+ INSERT INTO t1(rowid, content)
+ VALUES(2, 'abcdefghijklmnopqrstuvwyxz');
+ SELECT rowid, snippet(t1) FROM t1 WHERE t1 MATCH 'abcdefghijqrstuvwyxz'
+ }
+} {2 abcdefghijklmnopqrstuvwyxz}
+do_test fts2d-1.4 {
+ execsql {
+ SELECT rowid, snippet(t1) FROM t1 WHERE t1 MATCH 'abcdefghijXXXXqrstuvwyxz'
+ }
+} {2 abcdefghijklmnopqrstuvwyxz}
+do_test fts2d-1.5 {
+ execsql {
+ INSERT INTO t1(rowid, content)
+ VALUES(3, 'The value is 123456789');
+ SELECT rowid, snippet(t1) FROM t1 WHERE t1 MATCH '123789'
+ }
+} {3 {The value is 123456789}}
+do_test fts2d-1.6 {
+ execsql {
+ SELECT rowid, snippet(t1) FROM t1 WHERE t1 MATCH '123000000789'
+ }
+} {3 {The value is 123456789}}
+
+
+finish_test
--
cgit v1.1