summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2021-03-21 17:55:22 +0100
committerCarlos Garnacho <carlosg@gnome.org>2021-03-21 18:39:08 +0100
commit8a28feb1bff52bf518a4728cbebf2317ffc7b4bd (patch)
tree8b866697c8207f673d9ff05f2bff45833af0dc98
parent4c024b53e6f64213284dc8cf7bb94df51859bd21 (diff)
downloadtracker-8a28feb1bff52bf518a4728cbebf2317ffc7b4bd.tar.gz
tests: Add test for OPTIONAL inside GRAPH ?g {}
This broke in recent SQLite releases, and only caught by one tracker-miners test. Make it sure we have a test here for this.
-rw-r--r--tests/libtracker-data/graph/graph-7.out2
-rw-r--r--tests/libtracker-data/graph/graph-7.rq7
-rw-r--r--tests/libtracker-data/tracker-sparql-test.c1
3 files changed, 10 insertions, 0 deletions
diff --git a/tests/libtracker-data/graph/graph-7.out b/tests/libtracker-data/graph/graph-7.out
new file mode 100644
index 000000000..b87869c39
--- /dev/null
+++ b/tests/libtracker-data/graph/graph-7.out
@@ -0,0 +1,2 @@
+"http://example/graphA" "http://example/resource" "73"
+"http://example/graphB" "http://example/resource" "42"
diff --git a/tests/libtracker-data/graph/graph-7.rq b/tests/libtracker-data/graph/graph-7.rq
new file mode 100644
index 000000000..a72b4366e
--- /dev/null
+++ b/tests/libtracker-data/graph/graph-7.rq
@@ -0,0 +1,7 @@
+SELECT ?g ?s ?v WHERE {
+ GRAPH ?g {
+ ?s a rdfs:Resource .
+ OPTIONAL { ?s example:p ?v } .
+ }
+}
+ORDER BY ?g ?s ?v \ No newline at end of file
diff --git a/tests/libtracker-data/tracker-sparql-test.c b/tests/libtracker-data/tracker-sparql-test.c
index 9552d0aa4..60475720b 100644
--- a/tests/libtracker-data/tracker-sparql-test.c
+++ b/tests/libtracker-data/tracker-sparql-test.c
@@ -162,6 +162,7 @@ const TestInfo tests[] = {
{ "graph/graph-4", "graph/data-3", FALSE },
{ "graph/graph-5", "graph/data-4", FALSE },
{ "graph/graph-6", "graph/data-5", FALSE },
+ { "graph/graph-7", "graph/data-5", FALSE },
{ "graph/non-existent-1", "graph/data-1", FALSE },
{ "graph/non-existent-2", "graph/data-1", FALSE },
{ "graph/non-existent-3", "graph/data-1", FALSE },