[tracker/wip/carlosg/sparql-corners: 12/12] tests: Add test for nested multivalued properties as property functions




commit f2d2511b5cba7c77432043444eafeab10156b736
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Mar 1 18:55:34 2021 +0100

    tests: Add test for nested multivalued properties as property functions
    
    As the group_concat ordering is undefined, test with just one value.

 tests/libtracker-data/functions/data-5.ttl            | 19 +++++++++++++++++++
 .../functions/functions-property-2.out                |  3 +++
 .../libtracker-data/functions/functions-property-2.rq |  8 ++++++++
 tests/libtracker-data/tracker-sparql-test.c           |  1 +
 4 files changed, 31 insertions(+)
---
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 },


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