[tracker/wip/carlosg/zero-or-more-fix: 2/3] tests: Add tests for +/? property path operator finding 0-length results




commit 100468725969ec2edc0ea4bfd07a9c2368146e50
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sun Nov 7 16:47:54 2021 +0100

    tests: Add tests for +/? property path operator finding 0-length results
    
    These should also bring back the 0-length result even if there are no further
    results.

 tests/libtracker-data/property-paths/optional-path-2.out  | 1 +
 tests/libtracker-data/property-paths/optional-path-2.rq   | 5 +++++
 tests/libtracker-data/property-paths/recursive-path-3.out | 1 +
 tests/libtracker-data/property-paths/recursive-path-3.rq  | 5 +++++
 tests/libtracker-data/tracker-sparql-test.c               | 2 ++
 5 files changed, 14 insertions(+)
---
diff --git a/tests/libtracker-data/property-paths/optional-path-2.out 
b/tests/libtracker-data/property-paths/optional-path-2.out
new file mode 100644
index 000000000..68ab274fe
--- /dev/null
+++ b/tests/libtracker-data/property-paths/optional-path-2.out
@@ -0,0 +1 @@
+"http://xmlns.com/foaf/0.1/name";
diff --git a/tests/libtracker-data/property-paths/optional-path-2.rq 
b/tests/libtracker-data/property-paths/optional-path-2.rq
new file mode 100644
index 000000000..e151dcda5
--- /dev/null
+++ b/tests/libtracker-data/property-paths/optional-path-2.rq
@@ -0,0 +1,5 @@
+select ?u {
+  # Bind a value impossible to have foaf:knows
+  BIND (foaf:name AS ?u) .
+  ?u foaf:knows? ?a
+}
diff --git a/tests/libtracker-data/property-paths/recursive-path-3.out 
b/tests/libtracker-data/property-paths/recursive-path-3.out
new file mode 100644
index 000000000..68ab274fe
--- /dev/null
+++ b/tests/libtracker-data/property-paths/recursive-path-3.out
@@ -0,0 +1 @@
+"http://xmlns.com/foaf/0.1/name";
diff --git a/tests/libtracker-data/property-paths/recursive-path-3.rq 
b/tests/libtracker-data/property-paths/recursive-path-3.rq
new file mode 100644
index 000000000..ae8ff050e
--- /dev/null
+++ b/tests/libtracker-data/property-paths/recursive-path-3.rq
@@ -0,0 +1,5 @@
+select ?u {
+  # Bind a value impossible to have foaf:knows
+  BIND (foaf:name AS ?u) .
+  ?u foaf:knows* ?a
+}
diff --git a/tests/libtracker-data/tracker-sparql-test.c b/tests/libtracker-data/tracker-sparql-test.c
index 4d6312c0f..77752bcaf 100644
--- a/tests/libtracker-data/tracker-sparql-test.c
+++ b/tests/libtracker-data/tracker-sparql-test.c
@@ -268,8 +268,10 @@ const TestInfo tests[] = {
        { "property-paths/sequence-path-2", "property-paths/data", FALSE },
        { "property-paths/sequence-path-3", "property-paths/data", FALSE },
        { "property-paths/optional-path-1", "property-paths/data", FALSE },
+       { "property-paths/optional-path-2", "property-paths/data", FALSE },
        { "property-paths/recursive-path-1", "property-paths/data", FALSE },
        { "property-paths/recursive-path-2", "property-paths/data", FALSE },
+       { "property-paths/recursive-path-3", "property-paths/data", FALSE },
        { "property-paths/alternative-path-1", "property-paths/data", FALSE },
        { "property-paths/alternative-path-2", "property-paths/data", FALSE },
        { "property-paths/mixed-inverse-and-sequence-1", "property-paths/data", FALSE },


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