summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2020-09-10 18:49:51 +0200
committerCarlos Garnacho <carlosg@gnome.org>2020-09-30 13:07:37 +0200
commitd153c94f75005adb1ffdb447f7d3ef78daf9e0c6 (patch)
treec03f7b0e0bbc1e89ae171d3ca95ef0bc063b7280
parentb4418cc1510e552099c89d9eb4bdd42ef76de8b7 (diff)
downloadtracker-d153c94f75005adb1ffdb447f7d3ef78daf9e0c6.tar.gz
tests: Add test for title sort
-rw-r--r--tests/libtracker-data/sort/data-title-sort-1.ttl11
-rw-r--r--tests/libtracker-data/sort/query-title-sort-1.out3
-rw-r--r--tests/libtracker-data/sort/query-title-sort-1.rq4
-rw-r--r--tests/libtracker-data/tracker-sparql-test.c1
4 files changed, 19 insertions, 0 deletions
diff --git a/tests/libtracker-data/sort/data-title-sort-1.ttl b/tests/libtracker-data/sort/data-title-sort-1.ttl
new file mode 100644
index 000000000..e877edbe8
--- /dev/null
+++ b/tests/libtracker-data/sort/data-title-sort-1.ttl
@@ -0,0 +1,11 @@
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+
+_:a a owl:Thing .
+_:b a owl:Thing .
+_:c a owl:Thing .
+
+_:a foaf:name "The Shining".
+_:b foaf:name "Lord Of The Rings" .
+_:c foaf:name "The Lord Of The Flies" .
diff --git a/tests/libtracker-data/sort/query-title-sort-1.out b/tests/libtracker-data/sort/query-title-sort-1.out
new file mode 100644
index 000000000..20749b4df
--- /dev/null
+++ b/tests/libtracker-data/sort/query-title-sort-1.out
@@ -0,0 +1,3 @@
+"The Lord Of The Flies"
+"Lord Of The Rings"
+"The Shining"
diff --git a/tests/libtracker-data/sort/query-title-sort-1.rq b/tests/libtracker-data/sort/query-title-sort-1.rq
new file mode 100644
index 000000000..8256937c3
--- /dev/null
+++ b/tests/libtracker-data/sort/query-title-sort-1.rq
@@ -0,0 +1,4 @@
+PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+SELECT ?name
+WHERE { ?x foaf:name ?name }
+ORDER BY tracker:title-order(?name)
diff --git a/tests/libtracker-data/tracker-sparql-test.c b/tests/libtracker-data/tracker-sparql-test.c
index ca36c3798..73bd93dd1 100644
--- a/tests/libtracker-data/tracker-sparql-test.c
+++ b/tests/libtracker-data/tracker-sparql-test.c
@@ -197,6 +197,7 @@ const TestInfo tests[] = {
{ "sort/query-sort-7", "sort/data-sort-1", FALSE },
{ "sort/query-sort-8", "sort/data-sort-5", FALSE },
{ "sort/query-sort-9", "sort/data-sort-5", FALSE },
+ { "sort/query-title-sort-1", "sort/data-title-sort-1", FALSE },
{ "subqueries/subqueries-1", "subqueries/data-1", FALSE },
{ "subqueries/subqueries-union-1", "subqueries/data-1", FALSE },
{ "subqueries/subqueries-union-2", "subqueries/data-1", FALSE },