[tracker/wip/carlosg/sparql1.1: 110/113] tests: Add tests for CONSTRUCT
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/wip/carlosg/sparql1.1: 110/113] tests: Add tests for CONSTRUCT
- Date: Sun, 21 Jul 2019 14:38:28 +0000 (UTC)
commit ec701013ad50adc9d6a6acba8ee4eb8974dfb1ff
Author: Carlos Garnacho <carlosg gnome org>
Date: Sun Jul 21 12:45:43 2019 +0200
tests: Add tests for CONSTRUCT
tests/libtracker-data/construct/construct-pattern.out | 12 ++++++++++++
tests/libtracker-data/construct/construct-pattern.rq | 3 +++
tests/libtracker-data/construct/construct-where.out | 8 ++++++++
tests/libtracker-data/construct/construct-where.rq | 1 +
tests/libtracker-data/construct/construct-with-modifiers.out | 4 ++++
tests/libtracker-data/construct/construct-with-modifiers.rq | 3 +++
tests/libtracker-data/tracker-sparql-test.c | 3 +++
7 files changed, 34 insertions(+)
---
diff --git a/tests/libtracker-data/construct/construct-pattern.out
b/tests/libtracker-data/construct/construct-pattern.out
new file mode 100644
index 000000000..bda80d4c6
--- /dev/null
+++ b/tests/libtracker-data/construct/construct-pattern.out
@@ -0,0 +1,12 @@
+"a" "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" "http://xmlns.com/foaf/0.1/Person"
+"b" "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" "http://xmlns.com/foaf/0.1/Person"
+"c" "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" "http://xmlns.com/foaf/0.1/Person"
+"d" "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" "http://xmlns.com/foaf/0.1/Person"
+"a" "http://xmlns.com/foaf/0.1/name" "nameA"
+"b" "http://xmlns.com/foaf/0.1/name" "nameB"
+"c" "http://xmlns.com/foaf/0.1/name" "nameC"
+"d" "http://xmlns.com/foaf/0.1/name" "nameD"
+"a" "http://xmlns.com/foaf/0.1/mbox" "mailto:bob@work"
+"b" "http://xmlns.com/foaf/0.1/mbox" "mailto:bob@work"
+"c" "http://xmlns.com/foaf/0.1/mbox" "mailto:bob@work"
+"d" "http://xmlns.com/foaf/0.1/mbox" "mailto:bob@work"
diff --git a/tests/libtracker-data/construct/construct-pattern.rq
b/tests/libtracker-data/construct/construct-pattern.rq
new file mode 100644
index 000000000..d686a48fd
--- /dev/null
+++ b/tests/libtracker-data/construct/construct-pattern.rq
@@ -0,0 +1,3 @@
+PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+
+CONSTRUCT { ?u a foaf:Person ; foaf:name ?name ; foaf:mbox <mailto:bob@work> } WHERE { ?u a example:A ;
example:name ?name }
diff --git a/tests/libtracker-data/construct/construct-where.out
b/tests/libtracker-data/construct/construct-where.out
new file mode 100644
index 000000000..6fb4dde44
--- /dev/null
+++ b/tests/libtracker-data/construct/construct-where.out
@@ -0,0 +1,8 @@
+"a" "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" "http://example/A"
+"b" "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" "http://example/A"
+"c" "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" "http://example/A"
+"d" "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" "http://example/A"
+"a" "http://example/name" "nameA"
+"b" "http://example/name" "nameB"
+"c" "http://example/name" "nameC"
+"d" "http://example/name" "nameD"
diff --git a/tests/libtracker-data/construct/construct-where.rq
b/tests/libtracker-data/construct/construct-where.rq
new file mode 100644
index 000000000..cce9b98e7
--- /dev/null
+++ b/tests/libtracker-data/construct/construct-where.rq
@@ -0,0 +1 @@
+CONSTRUCT WHERE { ?u a example:A ; example:name ?l }
diff --git a/tests/libtracker-data/construct/construct-with-modifiers.out
b/tests/libtracker-data/construct/construct-with-modifiers.out
new file mode 100644
index 000000000..737959de6
--- /dev/null
+++ b/tests/libtracker-data/construct/construct-with-modifiers.out
@@ -0,0 +1,4 @@
+"c" "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" "http://xmlns.com/foaf/0.1/Person"
+"b" "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" "http://xmlns.com/foaf/0.1/Person"
+"c" "http://xmlns.com/foaf/0.1/name" "nameC"
+"b" "http://xmlns.com/foaf/0.1/name" "nameB"
diff --git a/tests/libtracker-data/construct/construct-with-modifiers.rq
b/tests/libtracker-data/construct/construct-with-modifiers.rq
new file mode 100644
index 000000000..2f2badefa
--- /dev/null
+++ b/tests/libtracker-data/construct/construct-with-modifiers.rq
@@ -0,0 +1,3 @@
+PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+
+CONSTRUCT { ?u a foaf:Person ; foaf:name ?name } WHERE { ?u a example:A ; example:name ?name ;
example:number ?number } ORDER BY DESC ?number LIMIT 2
diff --git a/tests/libtracker-data/tracker-sparql-test.c b/tests/libtracker-data/tracker-sparql-test.c
index 62952b7f5..257fead15 100644
--- a/tests/libtracker-data/tracker-sparql-test.c
+++ b/tests/libtracker-data/tracker-sparql-test.c
@@ -83,6 +83,9 @@ const TestInfo tests[] = {
{ "bnode/query-5", "bnode/data", FALSE },
{ "bnode-coreference/query", "bnode-coreference/data", FALSE },
{ "bound/bound1", "bound/data", FALSE },
+ { "construct/construct-where", "construct/data", FALSE },
+ { "construct/construct-pattern", "construct/data", FALSE },
+ { "construct/construct-with-modifiers", "construct/data", FALSE },
{ "datetime/delete-1", "datetime/data-3", FALSE },
{ "datetime/functions-localtime-1", "datetime/data-1", FALSE },
{ "datetime/functions-timezone-1", "datetime/data-2", FALSE },
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]