summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2021-03-01 18:55:34 +0100
committerCarlos Garnacho <carlosg@gnome.org>2021-03-01 18:59:58 +0100
commitf2d2511b5cba7c77432043444eafeab10156b736 (patch)
tree04177ba047995dadfd7f8369ac7f6c713dc3d514
parentb4cdb29f7a07fa73d03c5fb73319547058667225 (diff)
downloadtracker-wip/carlosg/sparql-corners.tar.gz
tests: Add test for nested multivalued properties as property functionswip/carlosg/sparql-corners
As the group_concat ordering is undefined, test with just one value.
-rw-r--r--tests/libtracker-data/functions/data-5.ttl19
-rw-r--r--tests/libtracker-data/functions/functions-property-2.out3
-rw-r--r--tests/libtracker-data/functions/functions-property-2.rq8
-rw-r--r--tests/libtracker-data/tracker-sparql-test.c1
4 files changed, 31 insertions, 0 deletions
diff --git a/tests/libtracker-data/functions/data-5.ttl b/tests/libtracker-data/functions/data-5.ttl
new file mode 100644
index 000000000..f82135711
--- /dev/null
+++ b/tests/libtracker-data/functions/data-5.ttl
@@ -0,0 +1,19 @@
+@prefix : <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+:x a :A .
+:x :s "first" .
+
+:q a :A .
+:q :s "second" .
+
+:ba a :B .
+:ba :o "First group" .
+:ba :a :x .
+
+:bb a :B .
+:bb :o "Second group" .
+:bb :a :q .
+
+:bc a :B .
+:bc :o "Third group" .
diff --git a/tests/libtracker-data/functions/functions-property-2.out b/tests/libtracker-data/functions/functions-property-2.out
new file mode 100644
index 000000000..0831c62bc
--- /dev/null
+++ b/tests/libtracker-data/functions/functions-property-2.out
@@ -0,0 +1,3 @@
+"http://example/ba" "first"
+"http://example/bb" "second"
+"http://example/bc"
diff --git a/tests/libtracker-data/functions/functions-property-2.rq b/tests/libtracker-data/functions/functions-property-2.rq
new file mode 100644
index 000000000..ec3193db5
--- /dev/null
+++ b/tests/libtracker-data/functions/functions-property-2.rq
@@ -0,0 +1,8 @@
+PREFIX ex: <http://example/>
+PREFIX ns: <http://www.w3.org/2005/xpath-functions#>
+
+SELECT ?b ex:s(ex:a(?b))
+{
+ ?b a ex:B ;
+}
+ORDER BY ?b
diff --git a/tests/libtracker-data/tracker-sparql-test.c b/tests/libtracker-data/tracker-sparql-test.c
index 6a92ba744..9552d0aa4 100644
--- a/tests/libtracker-data/tracker-sparql-test.c
+++ b/tests/libtracker-data/tracker-sparql-test.c
@@ -118,6 +118,7 @@ const TestInfo tests[] = {
{ "expr-ops/query-unplus-1", "expr-ops/data", FALSE },
{ "expr-ops/query-res-1", "expr-ops/data", FALSE },
{ "functions/functions-property-1", "functions/data-1", FALSE },
+ { "functions/functions-property-2", "functions/data-5", FALSE },
{ "functions/functions-tracker-1", "functions/data-1", FALSE },
{ "functions/functions-tracker-2", "functions/data-2", FALSE },
{ "functions/functions-tracker-3", "functions/data-2", FALSE },