diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2022-03-26 21:20:24 +0100 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2022-03-27 23:08:15 +0200 |
commit | 7ab14938c335aab539e67ef8768316b377e7a1d2 (patch) | |
tree | 927cde051e0d3bef3a04f21355c29aa21e4fb246 | |
parent | f1a328292d4ca2619c04beb5a901adcab50cfc11 (diff) | |
download | tracker-7ab14938c335aab539e67ef8768316b377e7a1d2.tar.gz |
tests: Add tests for negated property paths
23 files changed, 36 insertions, 0 deletions
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-11.out b/tests/libtracker-data/property-paths/negated-path-11.out new file mode 100644 index 000000000..09b6f23e7 --- /dev/null +++ b/tests/libtracker-data/property-paths/negated-path-11.out @@ -0,0 +1 @@ +"Bob" diff --git a/tests/libtracker-data/property-paths/negated-path-11.rq b/tests/libtracker-data/property-paths/negated-path-11.rq new file mode 100644 index 000000000..fca43d101 --- /dev/null +++ b/tests/libtracker-data/property-paths/negated-path-11.rq @@ -0,0 +1,2 @@ +# Only foaf:name is left +select ?a { [ foaf:name "Bob" ] !(nrl:modified|nrl:added|foaf:knows|foaf:member|foaf:mbox|a) ?a } order by ?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 --- /dev/null +++ b/tests/libtracker-data/property-paths/negated-path-4.out 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 --- /dev/null +++ b/tests/libtracker-data/property-paths/negated-path-7.out 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..59bc73ccc 100644 --- a/tests/libtracker-data/tracker-sparql-test.c +++ b/tests/libtracker-data/tracker-sparql-test.c @@ -313,6 +313,17 @@ 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/negated-path-11", "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 }, |