summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2023-03-20 16:23:04 +0100
committerCarlos Garnacho <carlosg@gnome.org>2023-03-20 16:37:13 +0100
commit827ba585eec44cf3710a82406783f47bcb64f9c3 (patch)
treefdd6508cea209a8a809549a24fe1c3e8ecafbc35 /tests
parent4216d7d1fbe44eeb81f73eac63d32b64cdf46ed3 (diff)
downloadtracker-827ba585eec44cf3710a82406783f47bcb64f9c3.tar.gz
tests: Add more FTS tests for search terms
Test matching of disjoint terms, and usage of explicit quotes to make exact matches.
Diffstat (limited to 'tests')
-rw-r--r--tests/fts/fts3aa-4.out8
-rw-r--r--tests/fts/fts3aa-4.rq1
-rw-r--r--tests/fts/fts3aa-5.out4
-rw-r--r--tests/fts/fts3aa-5.rq1
-rw-r--r--tests/fts/fts3aa-6.out2
-rw-r--r--tests/fts/fts3aa-6.rq1
-rw-r--r--tests/fts/fts3aa-7.out8
-rw-r--r--tests/fts/fts3aa-7.rq2
-rw-r--r--tests/fts/fts3aa-8.out4
-rw-r--r--tests/fts/fts3aa-8.rq2
-rw-r--r--tests/fts/fts3aa-9.out1
-rw-r--r--tests/fts/fts3aa-9.rq1
-rw-r--r--tests/fts/tracker-fts-test.c2
13 files changed, 36 insertions, 1 deletions
diff --git a/tests/fts/fts3aa-4.out b/tests/fts/fts3aa-4.out
new file mode 100644
index 000000000..4bdf28b05
--- /dev/null
+++ b/tests/fts/fts3aa-4.out
@@ -0,0 +1,8 @@
+"http://www.example.org/test#20"
+"http://www.example.org/test#21"
+"http://www.example.org/test#22"
+"http://www.example.org/test#23"
+"http://www.example.org/test#28"
+"http://www.example.org/test#29"
+"http://www.example.org/test#30"
+"http://www.example.org/test#31"
diff --git a/tests/fts/fts3aa-4.rq b/tests/fts/fts3aa-4.rq
new file mode 100644
index 000000000..76f97168c
--- /dev/null
+++ b/tests/fts/fts3aa-4.rq
@@ -0,0 +1 @@
+SELECT ?o WHERE { ?o fts:match "three five" } order by asc ?o
diff --git a/tests/fts/fts3aa-5.out b/tests/fts/fts3aa-5.out
new file mode 100644
index 000000000..a2f64826a
--- /dev/null
+++ b/tests/fts/fts3aa-5.out
@@ -0,0 +1,4 @@
+"http://www.example.org/test#20"
+"http://www.example.org/test#21"
+"http://www.example.org/test#22"
+"http://www.example.org/test#23"
diff --git a/tests/fts/fts3aa-5.rq b/tests/fts/fts3aa-5.rq
new file mode 100644
index 000000000..9dbb5f174
--- /dev/null
+++ b/tests/fts/fts3aa-5.rq
@@ -0,0 +1 @@
+SELECT ?o WHERE { ?o fts:match "\"three five\"" } order by ?o
diff --git a/tests/fts/fts3aa-6.out b/tests/fts/fts3aa-6.out
new file mode 100644
index 000000000..2e57c7ed9
--- /dev/null
+++ b/tests/fts/fts3aa-6.out
@@ -0,0 +1,2 @@
+"http://www.example.org/test#15"
+"http://www.example.org/test#31"
diff --git a/tests/fts/fts3aa-6.rq b/tests/fts/fts3aa-6.rq
new file mode 100644
index 000000000..3482fe180
--- /dev/null
+++ b/tests/fts/fts3aa-6.rq
@@ -0,0 +1 @@
+SELECT ?o WHERE { ?o fts:match " \"two three\" four one" } order by ?o
diff --git a/tests/fts/fts3aa-7.out b/tests/fts/fts3aa-7.out
new file mode 100644
index 000000000..a082546ee
--- /dev/null
+++ b/tests/fts/fts3aa-7.out
@@ -0,0 +1,8 @@
+"http://www.example.org/test#10"
+"http://www.example.org/test#11"
+"http://www.example.org/test#14"
+"http://www.example.org/test#15"
+"http://www.example.org/test#26"
+"http://www.example.org/test#27"
+"http://www.example.org/test#30"
+"http://www.example.org/test#31"
diff --git a/tests/fts/fts3aa-7.rq b/tests/fts/fts3aa-7.rq
new file mode 100644
index 000000000..46aab7bda
--- /dev/null
+++ b/tests/fts/fts3aa-7.rq
@@ -0,0 +1,2 @@
+# Match contains an unfinished quote
+SELECT ?o WHERE { ?o fts:match "four \"two" } order by ?o
diff --git a/tests/fts/fts3aa-8.out b/tests/fts/fts3aa-8.out
new file mode 100644
index 000000000..9de74cce2
--- /dev/null
+++ b/tests/fts/fts3aa-8.out
@@ -0,0 +1,4 @@
+"http://www.example.org/test#10"
+"http://www.example.org/test#11"
+"http://www.example.org/test#26"
+"http://www.example.org/test#27"
diff --git a/tests/fts/fts3aa-8.rq b/tests/fts/fts3aa-8.rq
new file mode 100644
index 000000000..0874c737c
--- /dev/null
+++ b/tests/fts/fts3aa-8.rq
@@ -0,0 +1,2 @@
+# Match contains an unfinished quote
+SELECT ?o WHERE { ?o fts:match " \"two four " } order by ?o
diff --git a/tests/fts/fts3aa-9.out b/tests/fts/fts3aa-9.out
new file mode 100644
index 000000000..feaf7fc17
--- /dev/null
+++ b/tests/fts/fts3aa-9.out
@@ -0,0 +1 @@
+"http://www.example.org/test#31"
diff --git a/tests/fts/fts3aa-9.rq b/tests/fts/fts3aa-9.rq
new file mode 100644
index 000000000..72e1c98ed
--- /dev/null
+++ b/tests/fts/fts3aa-9.rq
@@ -0,0 +1 @@
+SELECT ?o WHERE { ?o fts:match "\"four five\" three \"one two\"" } order by ?o
diff --git a/tests/fts/tracker-fts-test.c b/tests/fts/tracker-fts-test.c
index b05da1aee..fd2308c4b 100644
--- a/tests/fts/tracker-fts-test.c
+++ b/tests/fts/tracker-fts-test.c
@@ -33,7 +33,7 @@ struct _TestInfo {
};
const TestInfo tests[] = {
- { "fts3aa", 3 },
+ { "fts3aa", 9 },
{ "fts3ae", 1 },
{ "consistency/partial-update", 2 },
{ "consistency/insert-or-replace", 2 },