[tracker/wip/carlosg/more-sparql-fixes: 5/5] tests: Add tests for negated property paths




commit 5c6ca516ce4e82b3c35fd56d3cf7ce71c54f7e14
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sat Mar 26 21:20:24 2022 +0100

    tests: Add tests for negated property paths

 tests/libtracker-data/property-paths/negated-path-1.out  |  1 +
 tests/libtracker-data/property-paths/negated-path-1.rq   |  1 +
 tests/libtracker-data/property-paths/negated-path-10.out |  2 ++
 tests/libtracker-data/property-paths/negated-path-10.rq  |  1 +
 tests/libtracker-data/property-paths/negated-path-2.out  |  1 +
 tests/libtracker-data/property-paths/negated-path-2.rq   |  1 +
 tests/libtracker-data/property-paths/negated-path-3.out  |  1 +
 tests/libtracker-data/property-paths/negated-path-3.rq   |  1 +
 tests/libtracker-data/property-paths/negated-path-4.out  |  0
 tests/libtracker-data/property-paths/negated-path-4.rq   |  1 +
 tests/libtracker-data/property-paths/negated-path-5.out  |  1 +
 tests/libtracker-data/property-paths/negated-path-5.rq   |  1 +
 tests/libtracker-data/property-paths/negated-path-6.out  |  1 +
 tests/libtracker-data/property-paths/negated-path-6.rq   |  2 ++
 tests/libtracker-data/property-paths/negated-path-7.out  |  0
 tests/libtracker-data/property-paths/negated-path-7.rq   |  2 ++
 tests/libtracker-data/property-paths/negated-path-8.out  |  1 +
 tests/libtracker-data/property-paths/negated-path-8.rq   |  1 +
 tests/libtracker-data/property-paths/negated-path-9.out  |  2 ++
 tests/libtracker-data/property-paths/negated-path-9.rq   |  1 +
 tests/libtracker-data/tracker-sparql-test.c              | 10 ++++++++++
 21 files changed, 32 insertions(+)
---
diff --git a/tests/libtracker-data/property-paths/negated-path-1.out 
b/tests/libtracker-data/property-paths/negated-path-1.out
new file mode 100644
index 000000000..ef0350743
--- /dev/null
+++ b/tests/libtracker-data/property-paths/negated-path-1.out
@@ -0,0 +1 @@
+"Alice"
diff --git a/tests/libtracker-data/property-paths/negated-path-1.rq 
b/tests/libtracker-data/property-paths/negated-path-1.rq
new file mode 100644
index 000000000..6c03cb750
--- /dev/null
+++ b/tests/libtracker-data/property-paths/negated-path-1.rq
@@ -0,0 +1 @@
+select foaf:name(?a) { [ foaf:name "Bob" ] !foaf:member ?a . ?a a foaf:Agent } order by foaf:name(?a)
diff --git a/tests/libtracker-data/property-paths/negated-path-10.out 
b/tests/libtracker-data/property-paths/negated-path-10.out
new file mode 100644
index 000000000..d76316a4c
--- /dev/null
+++ b/tests/libtracker-data/property-paths/negated-path-10.out
@@ -0,0 +1,2 @@
+"Alice"
+"Foo"
diff --git a/tests/libtracker-data/property-paths/negated-path-10.rq 
b/tests/libtracker-data/property-paths/negated-path-10.rq
new file mode 100644
index 000000000..4c8db4ab4
--- /dev/null
+++ b/tests/libtracker-data/property-paths/negated-path-10.rq
@@ -0,0 +1 @@
+select foaf:name(?a) { [ foaf:name "Bob" ] !(foaf:knows|^foaf:member|foaf:mbox) ?a . ?a a foaf:Agent } order 
by foaf:name(?a)
diff --git a/tests/libtracker-data/property-paths/negated-path-2.out 
b/tests/libtracker-data/property-paths/negated-path-2.out
new file mode 100644
index 000000000..ef0350743
--- /dev/null
+++ b/tests/libtracker-data/property-paths/negated-path-2.out
@@ -0,0 +1 @@
+"Alice"
diff --git a/tests/libtracker-data/property-paths/negated-path-2.rq 
b/tests/libtracker-data/property-paths/negated-path-2.rq
new file mode 100644
index 000000000..4cca76cf5
--- /dev/null
+++ b/tests/libtracker-data/property-paths/negated-path-2.rq
@@ -0,0 +1 @@
+select foaf:name(?a) { [ foaf:name "Bob" ] !(foaf:member) ?a . ?a a foaf:Agent } order by foaf:name(?a)
diff --git a/tests/libtracker-data/property-paths/negated-path-3.out 
b/tests/libtracker-data/property-paths/negated-path-3.out
new file mode 100644
index 000000000..ef0350743
--- /dev/null
+++ b/tests/libtracker-data/property-paths/negated-path-3.out
@@ -0,0 +1 @@
+"Alice"
diff --git a/tests/libtracker-data/property-paths/negated-path-3.rq 
b/tests/libtracker-data/property-paths/negated-path-3.rq
new file mode 100644
index 000000000..284b86b7b
--- /dev/null
+++ b/tests/libtracker-data/property-paths/negated-path-3.rq
@@ -0,0 +1 @@
+select foaf:name(?a) { [ foaf:name "Bob" ] !(foaf:member|foaf:mbox) ?a . ?a a foaf:Agent } order by 
foaf:name(?a)
diff --git a/tests/libtracker-data/property-paths/negated-path-4.out 
b/tests/libtracker-data/property-paths/negated-path-4.out
new file mode 100644
index 000000000..e69de29bb
diff --git a/tests/libtracker-data/property-paths/negated-path-4.rq 
b/tests/libtracker-data/property-paths/negated-path-4.rq
new file mode 100644
index 000000000..6186ff4b4
--- /dev/null
+++ b/tests/libtracker-data/property-paths/negated-path-4.rq
@@ -0,0 +1 @@
+select foaf:name(?a) { [ foaf:name "Bob" ] !(foaf:member|foaf:knows) ?a . ?a a foaf:Agent } order by 
foaf:name(?a)
diff --git a/tests/libtracker-data/property-paths/negated-path-5.out 
b/tests/libtracker-data/property-paths/negated-path-5.out
new file mode 100644
index 000000000..ef0350743
--- /dev/null
+++ b/tests/libtracker-data/property-paths/negated-path-5.out
@@ -0,0 +1 @@
+"Alice"
diff --git a/tests/libtracker-data/property-paths/negated-path-5.rq 
b/tests/libtracker-data/property-paths/negated-path-5.rq
new file mode 100644
index 000000000..985b2a1f4
--- /dev/null
+++ b/tests/libtracker-data/property-paths/negated-path-5.rq
@@ -0,0 +1 @@
+select foaf:name(?a) { [ foaf:name "Bob" ] !^foaf:member ?a . ?a a foaf:Agent } order by foaf:name(?a)
diff --git a/tests/libtracker-data/property-paths/negated-path-6.out 
b/tests/libtracker-data/property-paths/negated-path-6.out
new file mode 100644
index 000000000..ef0350743
--- /dev/null
+++ b/tests/libtracker-data/property-paths/negated-path-6.out
@@ -0,0 +1 @@
+"Alice"
diff --git a/tests/libtracker-data/property-paths/negated-path-6.rq 
b/tests/libtracker-data/property-paths/negated-path-6.rq
new file mode 100644
index 000000000..e6c4b611b
--- /dev/null
+++ b/tests/libtracker-data/property-paths/negated-path-6.rq
@@ -0,0 +1,2 @@
+# The existing inverse relation is '_:alice foaf:knows _:bob'
+select foaf:name(?a) { [ foaf:name "Bob" ] !(^foaf:member) ?a . ?a a foaf:Agent } order by foaf:name(?a)
diff --git a/tests/libtracker-data/property-paths/negated-path-7.out 
b/tests/libtracker-data/property-paths/negated-path-7.out
new file mode 100644
index 000000000..e69de29bb
diff --git a/tests/libtracker-data/property-paths/negated-path-7.rq 
b/tests/libtracker-data/property-paths/negated-path-7.rq
new file mode 100644
index 000000000..19a1859f5
--- /dev/null
+++ b/tests/libtracker-data/property-paths/negated-path-7.rq
@@ -0,0 +1,2 @@
+# The existing inverse relation is '_:alice foaf:knows _:bob'
+select foaf:name(?a) { [ foaf:name "Bob" ] !(^foaf:knows) ?a . ?a a foaf:Agent } order by foaf:name(?a)
diff --git a/tests/libtracker-data/property-paths/negated-path-8.out 
b/tests/libtracker-data/property-paths/negated-path-8.out
new file mode 100644
index 000000000..ef0350743
--- /dev/null
+++ b/tests/libtracker-data/property-paths/negated-path-8.out
@@ -0,0 +1 @@
+"Alice"
diff --git a/tests/libtracker-data/property-paths/negated-path-8.rq 
b/tests/libtracker-data/property-paths/negated-path-8.rq
new file mode 100644
index 000000000..0419f90af
--- /dev/null
+++ b/tests/libtracker-data/property-paths/negated-path-8.rq
@@ -0,0 +1 @@
+select foaf:name(?a) { ?a a foaf:Agent; !(^foaf:mbox|^foaf:member) [ foaf:name "Bob"] } order by 
foaf:name(?a)
diff --git a/tests/libtracker-data/property-paths/negated-path-9.out 
b/tests/libtracker-data/property-paths/negated-path-9.out
new file mode 100644
index 000000000..d76316a4c
--- /dev/null
+++ b/tests/libtracker-data/property-paths/negated-path-9.out
@@ -0,0 +1,2 @@
+"Alice"
+"Foo"
diff --git a/tests/libtracker-data/property-paths/negated-path-9.rq 
b/tests/libtracker-data/property-paths/negated-path-9.rq
new file mode 100644
index 000000000..9c406c07e
--- /dev/null
+++ b/tests/libtracker-data/property-paths/negated-path-9.rq
@@ -0,0 +1 @@
+select foaf:name(?a) { [ foaf:name "Bob" ] !(foaf:knows|^foaf:member) ?a . ?a a foaf:Agent } order by 
foaf:name(?a)
diff --git a/tests/libtracker-data/tracker-sparql-test.c b/tests/libtracker-data/tracker-sparql-test.c
index 0ffc3a7b6..3a29806fb 100644
--- a/tests/libtracker-data/tracker-sparql-test.c
+++ b/tests/libtracker-data/tracker-sparql-test.c
@@ -313,6 +313,16 @@ const TestInfo tests[] = {
        { "property-paths/alternative-path-1", "property-paths/data", FALSE },
        { "property-paths/alternative-path-2", "property-paths/data", FALSE },
        { "property-paths/alternative-path-3", "property-paths/data", FALSE },
+       { "property-paths/negated-path-1", "property-paths/data", FALSE },
+       { "property-paths/negated-path-2", "property-paths/data", FALSE },
+       { "property-paths/negated-path-3", "property-paths/data", FALSE },
+       { "property-paths/negated-path-4", "property-paths/data", FALSE },
+       { "property-paths/negated-path-5", "property-paths/data", FALSE },
+       { "property-paths/negated-path-6", "property-paths/data", FALSE },
+       { "property-paths/negated-path-7", "property-paths/data", FALSE },
+       { "property-paths/negated-path-8", "property-paths/data", FALSE },
+       { "property-paths/negated-path-9", "property-paths/data", FALSE },
+       { "property-paths/negated-path-10", "property-paths/data", FALSE },
        { "property-paths/mixed-inverse-and-sequence-1", "property-paths/data", FALSE },
        { "property-paths/mixed-inverse-and-sequence-2", "property-paths/data", FALSE },
        { "property-paths/mixed-inverse-and-sequence-3", "property-paths/data", FALSE },


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