[tracker/wip/carlosg/grilo-fixes: 9/9] tests: Add tests for UNION of subselects with different variables on left/right



commit 27b9ada273e1b7239615b060aa35eb1d1e8bc68d
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue May 26 20:22:19 2020 +0200

    tests: Add tests for UNION of subselects with different variables on left/right
    
    These were triggering SQL failures, but shouldn't.

 tests/libtracker-data/subqueries/subqueries-union-3.out | 7 +++++++
 tests/libtracker-data/subqueries/subqueries-union-3.rq  | 9 +++++++++
 tests/libtracker-data/tracker-sparql-test.c             | 1 +
 3 files changed, 17 insertions(+)
---
diff --git a/tests/libtracker-data/subqueries/subqueries-union-3.out 
b/tests/libtracker-data/subqueries/subqueries-union-3.out
new file mode 100644
index 000000000..d445a12f9
--- /dev/null
+++ b/tests/libtracker-data/subqueries/subqueries-union-3.out
@@ -0,0 +1,7 @@
+"http://example.org/ns#group1"; ""      "group"
+"http://example.org/ns#group2"; ""      "group"
+"http://example.org/ns#msg1";   "message"       ""
+"http://example.org/ns#msg2";   "message"       ""
+"http://example.org/ns#msg3";   "message"       ""
+"http://example.org/ns#msg4";   "message"       ""
+"http://example.org/ns#msg5";   "message"       ""
diff --git a/tests/libtracker-data/subqueries/subqueries-union-3.rq 
b/tests/libtracker-data/subqueries/subqueries-union-3.rq
new file mode 100644
index 000000000..443736f8f
--- /dev/null
+++ b/tests/libtracker-data/subqueries/subqueries-union-3.rq
@@ -0,0 +1,9 @@
+SELECT ?s COALESCE(?a, '') COALESCE(?b, '') WHERE {
+       {
+               SELECT ?s "message" AS ?a
+               WHERE { ?s a example:Message }
+       } UNION {
+               SELECT ?s "group" AS ?b
+               WHERE { ?s a example:Group }
+       }
+} ORDER BY ?s ?a ?b
diff --git a/tests/libtracker-data/tracker-sparql-test.c b/tests/libtracker-data/tracker-sparql-test.c
index 331048ad2..951ef2fd1 100644
--- a/tests/libtracker-data/tracker-sparql-test.c
+++ b/tests/libtracker-data/tracker-sparql-test.c
@@ -194,6 +194,7 @@ const TestInfo tests[] = {
        { "subqueries/subqueries-1", "subqueries/data-1", FALSE },
        { "subqueries/subqueries-union-1", "subqueries/data-1", FALSE },
        { "subqueries/subqueries-union-2", "subqueries/data-1", FALSE },
+       { "subqueries/subqueries-union-3", "subqueries/data-1", FALSE },
        { "subqueries/subqueries-minus-1", "subqueries/data-1", FALSE },
        { "subqueries/subqueries-minus-2", "subqueries/data-1", FALSE },
        { "subqueries/subqueries-minus-3", "subqueries/data-1", FALSE },


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