[tracker/wip/carlosg/property-paths: 6/6] tests: Add a bunch of property path tests



commit 7e09abe116b4dcedf177f3cf8f66ce347a4a8075
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue Dec 25 20:35:46 2018 +0100

    tests: Add a bunch of property path tests
    
    Alternative, recursive, optional paths are tested, and combinations
    of those.

 tests/libtracker-data/property-paths/alternative-path-1.out  |  5 +++++
 tests/libtracker-data/property-paths/alternative-path-1.rq   |  1 +
 tests/libtracker-data/property-paths/alternative-path-2.out  |  1 +
 tests/libtracker-data/property-paths/alternative-path-2.rq   |  1 +
 .../property-paths/mixed-inverse-and-sequence-3.out          |  2 ++
 .../property-paths/mixed-inverse-and-sequence-3.rq           |  1 +
 .../property-paths/mixed-recursive-and-alternative-1.out     |  7 +++++++
 .../property-paths/mixed-recursive-and-alternative-1.rq      |  1 +
 .../property-paths/mixed-recursive-and-alternative-2.out     |  7 +++++++
 .../property-paths/mixed-recursive-and-alternative-2.rq      |  1 +
 .../property-paths/mixed-recursive-and-inverse-1.out         |  1 +
 .../property-paths/mixed-recursive-and-inverse-1.rq          |  1 +
 .../property-paths/mixed-recursive-and-inverse-2.out         |  1 +
 .../property-paths/mixed-recursive-and-inverse-2.rq          |  1 +
 .../property-paths/mixed-recursive-and-inverse-3.out         |  1 +
 .../property-paths/mixed-recursive-and-inverse-3.rq          |  1 +
 .../property-paths/mixed-recursive-and-sequence-1.out        |  2 ++
 .../property-paths/mixed-recursive-and-sequence-1.rq         |  1 +
 tests/libtracker-data/property-paths/optional-path-1.out     |  2 ++
 tests/libtracker-data/property-paths/optional-path-1.rq      |  1 +
 tests/libtracker-data/property-paths/recursive-path-1.out    |  2 ++
 tests/libtracker-data/property-paths/recursive-path-1.rq     |  1 +
 tests/libtracker-data/property-paths/recursive-path-2.out    |  1 +
 tests/libtracker-data/property-paths/recursive-path-2.rq     |  1 +
 tests/libtracker-data/tracker-sparql-test.c                  | 12 ++++++++++++
 25 files changed, 56 insertions(+)
---
diff --git a/tests/libtracker-data/property-paths/alternative-path-1.out 
b/tests/libtracker-data/property-paths/alternative-path-1.out
new file mode 100644
index 000000000..d4ba27789
--- /dev/null
+++ b/tests/libtracker-data/property-paths/alternative-path-1.out
@@ -0,0 +1,5 @@
+"Alice"        "Bob"
+"Alice"        "Foo"
+"Bob"  "Alice"
+"Bob"  "Foo"
+"Eve"  "Fred"
diff --git a/tests/libtracker-data/property-paths/alternative-path-1.rq 
b/tests/libtracker-data/property-paths/alternative-path-1.rq
new file mode 100644
index 000000000..ddd3a0732
--- /dev/null
+++ b/tests/libtracker-data/property-paths/alternative-path-1.rq
@@ -0,0 +1 @@
+select foaf:name(?u) foaf:name(?a) { ?u a foaf:Person . ?u foaf:knows|foaf:member ?a } order by 
foaf:name(?u) foaf:name(?a)
\ No newline at end of file
diff --git a/tests/libtracker-data/property-paths/alternative-path-2.out 
b/tests/libtracker-data/property-paths/alternative-path-2.out
new file mode 100644
index 000000000..ef0350743
--- /dev/null
+++ b/tests/libtracker-data/property-paths/alternative-path-2.out
@@ -0,0 +1 @@
+"Alice"
diff --git a/tests/libtracker-data/property-paths/alternative-path-2.rq 
b/tests/libtracker-data/property-paths/alternative-path-2.rq
new file mode 100644
index 000000000..b90ecc092
--- /dev/null
+++ b/tests/libtracker-data/property-paths/alternative-path-2.rq
@@ -0,0 +1 @@
+select foaf:name(?u) { ?u a foaf:Person . ?u foaf:name|(foaf:member/foaf:name) "Alice" } order by 
foaf:name(?u)
\ No newline at end of file
diff --git a/tests/libtracker-data/property-paths/mixed-inverse-and-sequence-3.out 
b/tests/libtracker-data/property-paths/mixed-inverse-and-sequence-3.out
new file mode 100644
index 000000000..d12a7b1c3
--- /dev/null
+++ b/tests/libtracker-data/property-paths/mixed-inverse-and-sequence-3.out
@@ -0,0 +1,2 @@
+"Alice"        "Alice"
+"Bob"  "Bob"
diff --git a/tests/libtracker-data/property-paths/mixed-inverse-and-sequence-3.rq 
b/tests/libtracker-data/property-paths/mixed-inverse-and-sequence-3.rq
new file mode 100644
index 000000000..3383f36b8
--- /dev/null
+++ b/tests/libtracker-data/property-paths/mixed-inverse-and-sequence-3.rq
@@ -0,0 +1 @@
+select foaf:name(?a) foaf:name(?b) { ?a ^(foaf:knows/foaf:knows) ?b } order by foaf:name(?a) foaf:name(?b)
\ No newline at end of file
diff --git a/tests/libtracker-data/property-paths/mixed-recursive-and-alternative-1.out 
b/tests/libtracker-data/property-paths/mixed-recursive-and-alternative-1.out
new file mode 100644
index 000000000..878be5329
--- /dev/null
+++ b/tests/libtracker-data/property-paths/mixed-recursive-and-alternative-1.out
@@ -0,0 +1,7 @@
+"Alice"        "Alice"
+"Alice"        "Bob"
+"Alice"        "Foo"
+"Bob"  "Alice"
+"Bob"  "Bob"
+"Bob"  "Foo"
+"Eve"  "Fred"
diff --git a/tests/libtracker-data/property-paths/mixed-recursive-and-alternative-1.rq 
b/tests/libtracker-data/property-paths/mixed-recursive-and-alternative-1.rq
new file mode 100644
index 000000000..44d2d7f88
--- /dev/null
+++ b/tests/libtracker-data/property-paths/mixed-recursive-and-alternative-1.rq
@@ -0,0 +1 @@
+select foaf:name(?u) foaf:name(?a) { ?u foaf:knows+|foaf:member ?a } order by foaf:name(?u) foaf:name(?a)
\ No newline at end of file
diff --git a/tests/libtracker-data/property-paths/mixed-recursive-and-alternative-2.out 
b/tests/libtracker-data/property-paths/mixed-recursive-and-alternative-2.out
new file mode 100644
index 000000000..878be5329
--- /dev/null
+++ b/tests/libtracker-data/property-paths/mixed-recursive-and-alternative-2.out
@@ -0,0 +1,7 @@
+"Alice"        "Alice"
+"Alice"        "Bob"
+"Alice"        "Foo"
+"Bob"  "Alice"
+"Bob"  "Bob"
+"Bob"  "Foo"
+"Eve"  "Fred"
diff --git a/tests/libtracker-data/property-paths/mixed-recursive-and-alternative-2.rq 
b/tests/libtracker-data/property-paths/mixed-recursive-and-alternative-2.rq
new file mode 100644
index 000000000..7f4c969c5
--- /dev/null
+++ b/tests/libtracker-data/property-paths/mixed-recursive-and-alternative-2.rq
@@ -0,0 +1 @@
+select foaf:name(?u) foaf:name(?a) { ?u (foaf:knows|foaf:member)+ ?a } order by foaf:name(?u) foaf:name(?a)
\ No newline at end of file
diff --git a/tests/libtracker-data/property-paths/mixed-recursive-and-inverse-1.out 
b/tests/libtracker-data/property-paths/mixed-recursive-and-inverse-1.out
new file mode 100644
index 000000000..0c64aed0a
--- /dev/null
+++ b/tests/libtracker-data/property-paths/mixed-recursive-and-inverse-1.out
@@ -0,0 +1 @@
+"Fred" "Eve"
diff --git a/tests/libtracker-data/property-paths/mixed-recursive-and-inverse-1.rq 
b/tests/libtracker-data/property-paths/mixed-recursive-and-inverse-1.rq
new file mode 100644
index 000000000..a43469234
--- /dev/null
+++ b/tests/libtracker-data/property-paths/mixed-recursive-and-inverse-1.rq
@@ -0,0 +1 @@
+select foaf:name(?u) foaf:name(?a) { ?u ^foaf:knows+ ?a . ?u foaf:name 'Fred' }
\ No newline at end of file
diff --git a/tests/libtracker-data/property-paths/mixed-recursive-and-inverse-2.out 
b/tests/libtracker-data/property-paths/mixed-recursive-and-inverse-2.out
new file mode 100644
index 000000000..0c64aed0a
--- /dev/null
+++ b/tests/libtracker-data/property-paths/mixed-recursive-and-inverse-2.out
@@ -0,0 +1 @@
+"Fred" "Eve"
diff --git a/tests/libtracker-data/property-paths/mixed-recursive-and-inverse-2.rq 
b/tests/libtracker-data/property-paths/mixed-recursive-and-inverse-2.rq
new file mode 100644
index 000000000..ebda97c36
--- /dev/null
+++ b/tests/libtracker-data/property-paths/mixed-recursive-and-inverse-2.rq
@@ -0,0 +1 @@
+select foaf:name(?u) foaf:name(?a) { ?u ^(foaf:knows+) ?a . ?u foaf:name 'Fred' }
\ No newline at end of file
diff --git a/tests/libtracker-data/property-paths/mixed-recursive-and-inverse-3.out 
b/tests/libtracker-data/property-paths/mixed-recursive-and-inverse-3.out
new file mode 100644
index 000000000..0c64aed0a
--- /dev/null
+++ b/tests/libtracker-data/property-paths/mixed-recursive-and-inverse-3.out
@@ -0,0 +1 @@
+"Fred" "Eve"
diff --git a/tests/libtracker-data/property-paths/mixed-recursive-and-inverse-3.rq 
b/tests/libtracker-data/property-paths/mixed-recursive-and-inverse-3.rq
new file mode 100644
index 000000000..3b5416657
--- /dev/null
+++ b/tests/libtracker-data/property-paths/mixed-recursive-and-inverse-3.rq
@@ -0,0 +1 @@
+select foaf:name(?u) foaf:name(?a) { ?u (^foaf:knows)+ ?a . ?u foaf:name 'Fred' }
\ No newline at end of file
diff --git a/tests/libtracker-data/property-paths/mixed-recursive-and-sequence-1.out 
b/tests/libtracker-data/property-paths/mixed-recursive-and-sequence-1.out
new file mode 100644
index 000000000..ac2dc970e
--- /dev/null
+++ b/tests/libtracker-data/property-paths/mixed-recursive-and-sequence-1.out
@@ -0,0 +1,2 @@
+"Alice"
+"Bob"
diff --git a/tests/libtracker-data/property-paths/mixed-recursive-and-sequence-1.rq 
b/tests/libtracker-data/property-paths/mixed-recursive-and-sequence-1.rq
new file mode 100644
index 000000000..1771d11d2
--- /dev/null
+++ b/tests/libtracker-data/property-paths/mixed-recursive-and-sequence-1.rq
@@ -0,0 +1 @@
+select foaf:name(?u) { ?u foaf:knows*/foaf:name 'Alice' } order by foaf:name(?u)
\ No newline at end of file
diff --git a/tests/libtracker-data/property-paths/optional-path-1.out 
b/tests/libtracker-data/property-paths/optional-path-1.out
new file mode 100644
index 000000000..525aee442
--- /dev/null
+++ b/tests/libtracker-data/property-paths/optional-path-1.out
@@ -0,0 +1,2 @@
+"Alice"        "Alice"
+"Alice"        "Bob"
diff --git a/tests/libtracker-data/property-paths/optional-path-1.rq 
b/tests/libtracker-data/property-paths/optional-path-1.rq
new file mode 100644
index 000000000..d1da57abb
--- /dev/null
+++ b/tests/libtracker-data/property-paths/optional-path-1.rq
@@ -0,0 +1 @@
+select foaf:name(?u) foaf:name(?a) { ?u foaf:name 'Alice'; foaf:knows? ?a } order by foaf:name(?u) 
foaf:name(?a)
\ No newline at end of file
diff --git a/tests/libtracker-data/property-paths/recursive-path-1.out 
b/tests/libtracker-data/property-paths/recursive-path-1.out
new file mode 100644
index 000000000..525aee442
--- /dev/null
+++ b/tests/libtracker-data/property-paths/recursive-path-1.out
@@ -0,0 +1,2 @@
+"Alice"        "Alice"
+"Alice"        "Bob"
diff --git a/tests/libtracker-data/property-paths/recursive-path-1.rq 
b/tests/libtracker-data/property-paths/recursive-path-1.rq
new file mode 100644
index 000000000..9bd80f372
--- /dev/null
+++ b/tests/libtracker-data/property-paths/recursive-path-1.rq
@@ -0,0 +1 @@
+select foaf:name(?u) foaf:name(?a) { ?u foaf:knows* ?a . FILTER (foaf:name(?u) = 'Alice') }
\ No newline at end of file
diff --git a/tests/libtracker-data/property-paths/recursive-path-2.out 
b/tests/libtracker-data/property-paths/recursive-path-2.out
new file mode 100644
index 000000000..a02d506ff
--- /dev/null
+++ b/tests/libtracker-data/property-paths/recursive-path-2.out
@@ -0,0 +1 @@
+"Alice"        "Bob"
diff --git a/tests/libtracker-data/property-paths/recursive-path-2.rq 
b/tests/libtracker-data/property-paths/recursive-path-2.rq
new file mode 100644
index 000000000..1ed508ee4
--- /dev/null
+++ b/tests/libtracker-data/property-paths/recursive-path-2.rq
@@ -0,0 +1 @@
+select foaf:name(?u) foaf:name(?a) { ?u foaf:knows+ ?a . FILTER (?u != ?a && foaf:name(?u) = 'Alice') } 
order by foaf:name(?u) foaf:name(?a)
\ No newline at end of file
diff --git a/tests/libtracker-data/tracker-sparql-test.c b/tests/libtracker-data/tracker-sparql-test.c
index 33a98fb11..2db5166ae 100644
--- a/tests/libtracker-data/tracker-sparql-test.c
+++ b/tests/libtracker-data/tracker-sparql-test.c
@@ -155,8 +155,20 @@ const TestInfo tests[] = {
        { "property-paths/sequence-path-1", "property-paths/data", FALSE },
        { "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/recursive-path-1", "property-paths/data", FALSE },
+       { "property-paths/recursive-path-2", "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 },
        { "property-paths/mixed-inverse-and-sequence-2", "property-paths/data", FALSE },
+       { "property-paths/mixed-inverse-and-sequence-3", "property-paths/data", FALSE },
+       { "property-paths/mixed-recursive-and-sequence-1", "property-paths/data", FALSE },
+       { "property-paths/mixed-recursive-and-alternative-1", "property-paths/data", FALSE },
+       { "property-paths/mixed-recursive-and-alternative-2", "property-paths/data", FALSE },
+       { "property-paths/mixed-recursive-and-inverse-1", "property-paths/data", FALSE },
+       { "property-paths/mixed-recursive-and-inverse-2", "property-paths/data", FALSE },
+       { "property-paths/mixed-recursive-and-inverse-3", "property-paths/data", FALSE },
        /* Update tests */
        { "update/insert-data-query-1", "update/insert-data-1", FALSE, FALSE },
        { "update/insert-data-query-2", "update/insert-data-2", FALSE, TRUE },


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