[tracker/miner-web: 39/76] libtracker-fts: Add prefix and limit tests



commit 834a78e9af1969a1c793d8a931704a80b0fe7dea
Author: Mikael Ottela <mikael ottela ixonos com>
Date:   Thu Feb 25 14:44:30 2010 +0100

    libtracker-fts: Add prefix and limit tests

 configure.ac                                   |    8 +++++---
 tests/libtracker-fts/Makefile.am               |    4 ++++
 tests/libtracker-fts/data.ontology             |    6 ++++++
 tests/libtracker-fts/limits/Makefile.am        |    8 ++++++++
 tests/libtracker-fts/limits/fts3limits-1.out   |    5 +++++
 tests/libtracker-fts/limits/fts3limits-1.rq    |    1 +
 tests/libtracker-fts/limits/fts3limits-2.rq    |    1 +
 tests/libtracker-fts/limits/fts3limits-3.out   |    7 +++++++
 tests/libtracker-fts/limits/fts3limits-3.rq    |    1 +
 tests/libtracker-fts/limits/fts3limits-4.rq    |    1 +
 tests/libtracker-fts/limits/fts3limits-data.rq |   13 +++++++++++++
 tests/libtracker-fts/prefix/Makefile.am        |    7 +++++++
 tests/libtracker-fts/prefix/fts3prefix-1.out   |    3 +++
 tests/libtracker-fts/prefix/fts3prefix-1.rq    |    1 +
 tests/libtracker-fts/prefix/fts3prefix-2.out   |    5 +++++
 tests/libtracker-fts/prefix/fts3prefix-2.rq    |    1 +
 tests/libtracker-fts/prefix/fts3prefix-3.out   |    7 +++++++
 tests/libtracker-fts/prefix/fts3prefix-3.rq    |    1 +
 tests/libtracker-fts/prefix/fts3prefix-data.rq |   13 +++++++++++++
 tests/libtracker-fts/tracker-fts-test.c        |    2 ++
 20 files changed, 92 insertions(+), 3 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 89d6b35..7492331 100644
--- a/configure.ac
+++ b/configure.ac
@@ -951,7 +951,7 @@ fi
 
 if test "x$enable_tracker_search_bar" = "xyes"; then
    if test "x$have_tracker_search_bar" != "xyes"; then
-      AC_MSG_ERROR([Couldn't find tracker-search-bar dependencies ($APP_REQUIREMENTS $APPLET_REQUIREMENTS).])   
+      AC_MSG_ERROR([Couldn't find tracker-search-bar dependencies ($APP_REQUIREMENTS $APPLET_REQUIREMENTS).])
    fi
 fi
 
@@ -979,7 +979,7 @@ fi
 
 if test "x$enable_tracker_search_tool" = "xyes"; then
    if test "x$have_tracker_search_tool" != "xyes"; then
-      AC_MSG_ERROR([Couldn't find tracker-search-tool dependencies ($APP_REQUIREMENTS $VALA_REQUIREMENTS).])   
+      AC_MSG_ERROR([Couldn't find tracker-search-tool dependencies ($APP_REQUIREMENTS $VALA_REQUIREMENTS).])
    fi
 fi
 
@@ -1552,7 +1552,7 @@ fi
 
 AM_CONDITIONAL(HAVE_GTK_DOC, test "$enable_gtk_doc" = "yes")
 AM_CONDITIONAL(HAVE_GRAPHVIZ_FDP, test -n "$GRAPHVIZ_FDP")
-  
+
 ##################################################################
 # Check for older tracker project files which can cause problems
 ##################################################################
@@ -1681,6 +1681,8 @@ AC_CONFIG_FILES([
 	tests/libtracker-data/turtle/Makefile
 	tests/libtracker-db/Makefile
 	tests/libtracker-fts/Makefile
+	tests/libtracker-fts/limits/Makefile
+	tests/libtracker-fts/prefix/Makefile
 	tests/functional-tests/Makefile
 	tests/functional-tests/data/Makefile
 	tests/functional-tests/data/Music/Makefile
diff --git a/tests/libtracker-fts/Makefile.am b/tests/libtracker-fts/Makefile.am
index 9fa6c92..ac8ec9c 100644
--- a/tests/libtracker-fts/Makefile.am
+++ b/tests/libtracker-fts/Makefile.am
@@ -1,5 +1,9 @@
 include $(top_srcdir)/Makefile.decl
 
+SUBDIRS = 			\
+	limits			\
+	prefix
+
 noinst_PROGRAMS = $(TEST_PROGS)
 
 TEST_PROGS += 								\
diff --git a/tests/libtracker-fts/data.ontology b/tests/libtracker-fts/data.ontology
index d865fe1..5d87d6b 100644
--- a/tests/libtracker-fts/data.ontology
+++ b/tests/libtracker-fts/data.ontology
@@ -21,3 +21,9 @@ test:p a rdf:Property ;
 	rdfs:range xsd:string ;
 	tracker:fulltextIndexed true .
 
+test:o a rdf:Property ;
+	nrl:maxCardinality 1 ;
+	rdfs:domain test:A ;
+	rdfs:range xsd:string ;
+	tracker:fulltextIndexed true ;
+	tracker:fulltextNoLimit true .
diff --git a/tests/libtracker-fts/limits/Makefile.am b/tests/libtracker-fts/limits/Makefile.am
new file mode 100644
index 0000000..0e6788b
--- /dev/null
+++ b/tests/libtracker-fts/limits/Makefile.am
@@ -0,0 +1,8 @@
+include $(top_srcdir)/Makefile.decl
+
+EXTRA_DIST = 				\
+	fts3limits-data.rq		\
+	fts3limits-1.rq			\
+	fts3limits-2.rq			\
+	fts3limits-3.rq			\
+	fts3limits-4.rq
diff --git a/tests/libtracker-fts/limits/fts3limits-1.out b/tests/libtracker-fts/limits/fts3limits-1.out
new file mode 100644
index 0000000..85d8792
--- /dev/null
+++ b/tests/libtracker-fts/limits/fts3limits-1.out
@@ -0,0 +1,5 @@
+"http://www.example.org/test#3";
+"http://www.example.org/test#4";
+"http://www.example.org/test#5";
+"http://www.example.org/test#6";
+"http://www.example.org/test#8";
diff --git a/tests/libtracker-fts/limits/fts3limits-1.rq b/tests/libtracker-fts/limits/fts3limits-1.rq
new file mode 100644
index 0000000..7127fa2
--- /dev/null
+++ b/tests/libtracker-fts/limits/fts3limits-1.rq
@@ -0,0 +1 @@
+SELECT ?o WHERE { ?o fts:match "tr*" }
diff --git a/tests/libtracker-fts/limits/fts3limits-2.out b/tests/libtracker-fts/limits/fts3limits-2.out
new file mode 100644
index 0000000..e69de29
diff --git a/tests/libtracker-fts/limits/fts3limits-2.rq b/tests/libtracker-fts/limits/fts3limits-2.rq
new file mode 100644
index 0000000..edd0348
--- /dev/null
+++ b/tests/libtracker-fts/limits/fts3limits-2.rq
@@ -0,0 +1 @@
+SELECT ?o WHERE { ?o fts:match "tr" }
diff --git a/tests/libtracker-fts/limits/fts3limits-3.out b/tests/libtracker-fts/limits/fts3limits-3.out
new file mode 100644
index 0000000..f18d2cd
--- /dev/null
+++ b/tests/libtracker-fts/limits/fts3limits-3.out
@@ -0,0 +1,7 @@
+"http://www.example.org/test#2";
+"http://www.example.org/test#3";
+"http://www.example.org/test#4";
+"http://www.example.org/test#5";
+"http://www.example.org/test#6";
+"http://www.example.org/test#8";
+"http://www.example.org/test#9";
diff --git a/tests/libtracker-fts/limits/fts3limits-3.rq b/tests/libtracker-fts/limits/fts3limits-3.rq
new file mode 100644
index 0000000..48f43fa
--- /dev/null
+++ b/tests/libtracker-fts/limits/fts3limits-3.rq
@@ -0,0 +1 @@
+SELECT ?o WHERE { ?o fts:match "pr*" }
diff --git a/tests/libtracker-fts/limits/fts3limits-4.out b/tests/libtracker-fts/limits/fts3limits-4.out
new file mode 100644
index 0000000..e69de29
diff --git a/tests/libtracker-fts/limits/fts3limits-4.rq b/tests/libtracker-fts/limits/fts3limits-4.rq
new file mode 100644
index 0000000..31cbc50
--- /dev/null
+++ b/tests/libtracker-fts/limits/fts3limits-4.rq
@@ -0,0 +1 @@
+SELECT ?o WHERE { ?o fts:match "pr" }
diff --git a/tests/libtracker-fts/limits/fts3limits-data.rq b/tests/libtracker-fts/limits/fts3limits-data.rq
new file mode 100644
index 0000000..2290ed5
--- /dev/null
+++ b/tests/libtracker-fts/limits/fts3limits-data.rq
@@ -0,0 +1,13 @@
+INSERT {
+	test:1 a test:A ; test:p "t"                            ; test:o "p" .
+	test:2 a test:A ; test:p "tr"                           ; test:o "pr" .
+	test:3 a test:A ; test:p "tra"                          ; test:o "pra" .
+	test:4 a test:A ; test:p "tracker test"                 ; test:o "pracker pest" .
+	test:5 a test:A ; test:p "tracking tester"              ; test:o "pracking pester" .
+	test:6 a test:A ; test:p "trash trash more trash"       ; test:o "prash prash more prash" .
+	test:7 a test:A ; test:p "racker ester"                 ; test:o "racker ester" .
+	test:8 a test:A ; test:p "TeStiNg TraCkEr"              ; test:o "PeStiNg PraCkEr" .
+	test:9 a test:A ; test:p "Prefix search with content"   ; test:o "Search with content" .
+	test:10 a test:A ; test:p "...and a one bit more here"  ; test:o "...and a one bit more here" .
+}
+
diff --git a/tests/libtracker-fts/prefix/Makefile.am b/tests/libtracker-fts/prefix/Makefile.am
new file mode 100644
index 0000000..1ae487c
--- /dev/null
+++ b/tests/libtracker-fts/prefix/Makefile.am
@@ -0,0 +1,7 @@
+include $(top_srcdir)/Makefile.decl
+
+EXTRA_DIST = 				\
+	fts3prefix-data.rq		\
+	fts3prefix-1.rq			\
+	fts3prefix-2.rq			\
+	fts3prefix-3.rq
diff --git a/tests/libtracker-fts/prefix/fts3prefix-1.out b/tests/libtracker-fts/prefix/fts3prefix-1.out
new file mode 100644
index 0000000..ff6290b
--- /dev/null
+++ b/tests/libtracker-fts/prefix/fts3prefix-1.out
@@ -0,0 +1,3 @@
+"http://www.example.org/test#4";
+"http://www.example.org/test#5";
+"http://www.example.org/test#8";
diff --git a/tests/libtracker-fts/prefix/fts3prefix-1.rq b/tests/libtracker-fts/prefix/fts3prefix-1.rq
new file mode 100644
index 0000000..3ad76d9
--- /dev/null
+++ b/tests/libtracker-fts/prefix/fts3prefix-1.rq
@@ -0,0 +1 @@
+SELECT ?o WHERE { ?o fts:match "trac*" }
diff --git a/tests/libtracker-fts/prefix/fts3prefix-2.out b/tests/libtracker-fts/prefix/fts3prefix-2.out
new file mode 100644
index 0000000..85d8792
--- /dev/null
+++ b/tests/libtracker-fts/prefix/fts3prefix-2.out
@@ -0,0 +1,5 @@
+"http://www.example.org/test#3";
+"http://www.example.org/test#4";
+"http://www.example.org/test#5";
+"http://www.example.org/test#6";
+"http://www.example.org/test#8";
diff --git a/tests/libtracker-fts/prefix/fts3prefix-2.rq b/tests/libtracker-fts/prefix/fts3prefix-2.rq
new file mode 100644
index 0000000..7127fa2
--- /dev/null
+++ b/tests/libtracker-fts/prefix/fts3prefix-2.rq
@@ -0,0 +1 @@
+SELECT ?o WHERE { ?o fts:match "tr*" }
diff --git a/tests/libtracker-fts/prefix/fts3prefix-3.out b/tests/libtracker-fts/prefix/fts3prefix-3.out
new file mode 100644
index 0000000..f18d2cd
--- /dev/null
+++ b/tests/libtracker-fts/prefix/fts3prefix-3.out
@@ -0,0 +1,7 @@
+"http://www.example.org/test#2";
+"http://www.example.org/test#3";
+"http://www.example.org/test#4";
+"http://www.example.org/test#5";
+"http://www.example.org/test#6";
+"http://www.example.org/test#8";
+"http://www.example.org/test#9";
diff --git a/tests/libtracker-fts/prefix/fts3prefix-3.rq b/tests/libtracker-fts/prefix/fts3prefix-3.rq
new file mode 100644
index 0000000..48f43fa
--- /dev/null
+++ b/tests/libtracker-fts/prefix/fts3prefix-3.rq
@@ -0,0 +1 @@
+SELECT ?o WHERE { ?o fts:match "pr*" }
diff --git a/tests/libtracker-fts/prefix/fts3prefix-data.rq b/tests/libtracker-fts/prefix/fts3prefix-data.rq
new file mode 100644
index 0000000..2290ed5
--- /dev/null
+++ b/tests/libtracker-fts/prefix/fts3prefix-data.rq
@@ -0,0 +1,13 @@
+INSERT {
+	test:1 a test:A ; test:p "t"                            ; test:o "p" .
+	test:2 a test:A ; test:p "tr"                           ; test:o "pr" .
+	test:3 a test:A ; test:p "tra"                          ; test:o "pra" .
+	test:4 a test:A ; test:p "tracker test"                 ; test:o "pracker pest" .
+	test:5 a test:A ; test:p "tracking tester"              ; test:o "pracking pester" .
+	test:6 a test:A ; test:p "trash trash more trash"       ; test:o "prash prash more prash" .
+	test:7 a test:A ; test:p "racker ester"                 ; test:o "racker ester" .
+	test:8 a test:A ; test:p "TeStiNg TraCkEr"              ; test:o "PeStiNg PraCkEr" .
+	test:9 a test:A ; test:p "Prefix search with content"   ; test:o "Search with content" .
+	test:10 a test:A ; test:p "...and a one bit more here"  ; test:o "...and a one bit more here" .
+}
+
diff --git a/tests/libtracker-fts/tracker-fts-test.c b/tests/libtracker-fts/tracker-fts-test.c
index 0ae805d..aa034df 100644
--- a/tests/libtracker-fts/tracker-fts-test.c
+++ b/tests/libtracker-fts/tracker-fts-test.c
@@ -43,6 +43,8 @@ struct _TestInfo {
 const TestInfo tests[] = {
 	{ "fts3aa", 2 },
 	{ "fts3ae", 1 },
+	{ "prefix/fts3prefix", 3 },
+	{ "limits/fts3limits", 4 },
 	{ NULL }
 };
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]