[tracker/wip/carlosg/sparql-corners: 4/12] tests: Add tests for unbound GRAPH variables




commit 0127a31091602b09ca184e5348bd785524bdb4e7
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Feb 26 21:04:23 2021 +0100

    tests: Add tests for unbound GRAPH variables
    
    Ensure these work correctly.

 tests/libtracker-data/graph/graph-unbound-1.out | 2 ++
 tests/libtracker-data/graph/graph-unbound-1.rq  | 1 +
 tests/libtracker-data/graph/graph-unbound-2.out | 2 ++
 tests/libtracker-data/graph/graph-unbound-2.rq  | 1 +
 tests/libtracker-data/graph/graph-unbound-3.out | 6 ++++++
 tests/libtracker-data/graph/graph-unbound-3.rq  | 1 +
 tests/libtracker-data/tracker-sparql-test.c     | 3 +++
 7 files changed, 16 insertions(+)
---
diff --git a/tests/libtracker-data/graph/graph-unbound-1.out b/tests/libtracker-data/graph/graph-unbound-1.out
new file mode 100644
index 000000000..dabff8b9f
--- /dev/null
+++ b/tests/libtracker-data/graph/graph-unbound-1.out
@@ -0,0 +1,2 @@
+"http://example/graphA";
+"http://example/graphB";
diff --git a/tests/libtracker-data/graph/graph-unbound-1.rq b/tests/libtracker-data/graph/graph-unbound-1.rq
new file mode 100644
index 000000000..2ed6176a5
--- /dev/null
+++ b/tests/libtracker-data/graph/graph-unbound-1.rq
@@ -0,0 +1 @@
+SELECT ?g { GRAPH ?g { } }
diff --git a/tests/libtracker-data/graph/graph-unbound-2.out b/tests/libtracker-data/graph/graph-unbound-2.out
new file mode 100644
index 000000000..b472b5bf2
--- /dev/null
+++ b/tests/libtracker-data/graph/graph-unbound-2.out
@@ -0,0 +1,2 @@
+"http://example/graphA";        "1"
+"http://example/graphB";        "1"
diff --git a/tests/libtracker-data/graph/graph-unbound-2.rq b/tests/libtracker-data/graph/graph-unbound-2.rq
new file mode 100644
index 000000000..34a91b5d7
--- /dev/null
+++ b/tests/libtracker-data/graph/graph-unbound-2.rq
@@ -0,0 +1 @@
+SELECT ?g ?a { GRAPH ?g { BIND (1 AS ?a) } } ORDER BY ?g ?a
diff --git a/tests/libtracker-data/graph/graph-unbound-3.out b/tests/libtracker-data/graph/graph-unbound-3.out
new file mode 100644
index 000000000..984ce4453
--- /dev/null
+++ b/tests/libtracker-data/graph/graph-unbound-3.out
@@ -0,0 +1,6 @@
+"http://example/graphA";        "1"
+"http://example/graphA";        "2"
+"http://example/graphA";        "3"
+"http://example/graphB";        "1"
+"http://example/graphB";        "2"
+"http://example/graphB";        "3"
diff --git a/tests/libtracker-data/graph/graph-unbound-3.rq b/tests/libtracker-data/graph/graph-unbound-3.rq
new file mode 100644
index 000000000..a95980fe9
--- /dev/null
+++ b/tests/libtracker-data/graph/graph-unbound-3.rq
@@ -0,0 +1 @@
+SELECT ?g ?a { GRAPH ?g { VALUES ?a { 1 2 3 } } } ORDER BY ?g ?a
diff --git a/tests/libtracker-data/tracker-sparql-test.c b/tests/libtracker-data/tracker-sparql-test.c
index 5b61365d5..abff972a5 100644
--- a/tests/libtracker-data/tracker-sparql-test.c
+++ b/tests/libtracker-data/tracker-sparql-test.c
@@ -160,6 +160,9 @@ const TestInfo tests[] = {
        { "graph/non-existent-1",  "graph/data-1", FALSE },
        { "graph/non-existent-2",  "graph/data-1", FALSE },
        { "graph/non-existent-3",  "graph/data-1", FALSE },
+       { "graph/graph-unbound-1", "graph/data-1", FALSE },
+       { "graph/graph-unbound-2", "graph/data-1", FALSE },
+       { "graph/graph-unbound-3", "graph/data-1", FALSE },
        { "graph/drop", "graph/data-drop", FALSE },
        { "graph/drop-non-existent", "graph/data-drop-non-existent", FALSE, TRUE },
        { "graph/drop-default", "graph/data-drop-default", FALSE },


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