[tracker/wip/carlosg/more-tests: 3/12] tests: Add test for title sort
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/wip/carlosg/more-tests: 3/12] tests: Add test for title sort
- Date: Wed, 30 Sep 2020 11:07:55 +0000 (UTC)
commit d153c94f75005adb1ffdb447f7d3ef78daf9e0c6
Author: Carlos Garnacho <carlosg gnome org>
Date: Thu Sep 10 18:49:51 2020 +0200
tests: Add test for title sort
tests/libtracker-data/sort/data-title-sort-1.ttl | 11 +++++++++++
tests/libtracker-data/sort/query-title-sort-1.out | 3 +++
tests/libtracker-data/sort/query-title-sort-1.rq | 4 ++++
tests/libtracker-data/tracker-sparql-test.c | 1 +
4 files changed, 19 insertions(+)
---
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 },
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]