[tracker/tracker-0.8] libtracker-data: Add scalar subquery union test



commit 4cac788ff72114cfb74312f3af8d711da2d91514
Author: Jürg Billeter <j bitron ch>
Date:   Tue May 18 15:34:22 2010 +0200

    libtracker-data: Add scalar subquery union test
    
    This tests variable handling in scalar subqueries.

 tests/libtracker-data/subqueries/Makefile.am       |    5 +++--
 .../subqueries/subqueries-union-2.out              |    5 +++++
 .../subqueries/subqueries-union-2.rq               |   14 ++++++++++++++
 tests/libtracker-data/tracker-sparql-test.c        |    1 +
 4 files changed, 23 insertions(+), 2 deletions(-)
---
diff --git a/tests/libtracker-data/subqueries/Makefile.am b/tests/libtracker-data/subqueries/Makefile.am
index 005717c..50e4a7e 100644
--- a/tests/libtracker-data/subqueries/Makefile.am
+++ b/tests/libtracker-data/subqueries/Makefile.am
@@ -6,5 +6,6 @@ EXTRA_DIST =                   \
 	subqueries-1.out       \
 	subqueries-1.rq        \
 	subqueries-union-1.out \
-	subqueries-union-1.rq
-
+	subqueries-union-1.rq  \
+	subqueries-union-2.out \
+	subqueries-union-2.rq
diff --git a/tests/libtracker-data/subqueries/subqueries-union-2.out b/tests/libtracker-data/subqueries/subqueries-union-2.out
new file mode 100644
index 0000000..2de3f5d
--- /dev/null
+++ b/tests/libtracker-data/subqueries/subqueries-union-2.out
@@ -0,0 +1,5 @@
+"http://example.org/ns#msg1";	"2009-12-01T00:00:00Z"
+"http://example.org/ns#msg2";	"2009-12-02T00:00:00Z"
+"http://example.org/ns#msg3";	"2009-12-03T00:00:00Z"
+"http://example.org/ns#msg4";	"2009-12-04T00:00:00Z"
+"http://example.org/ns#msg5";	"2009-12-05T00:00:00Z"
diff --git a/tests/libtracker-data/subqueries/subqueries-union-2.rq b/tests/libtracker-data/subqueries/subqueries-union-2.rq
new file mode 100644
index 0000000..a19870f
--- /dev/null
+++ b/tests/libtracker-data/subqueries/subqueries-union-2.rq
@@ -0,0 +1,14 @@
+SELECT ?msg (
+	SELECT ?date
+	WHERE
+	{
+		{
+			?msg example:date ?date .
+		} UNION {
+			?msg example:date ?date .
+		}
+	}
+) AS ?date
+WHERE {
+	?msg a example:Message
+} ORDER BY ?msg
diff --git a/tests/libtracker-data/tracker-sparql-test.c b/tests/libtracker-data/tracker-sparql-test.c
index 866f114..90f4fb5 100644
--- a/tests/libtracker-data/tracker-sparql-test.c
+++ b/tests/libtracker-data/tracker-sparql-test.c
@@ -97,6 +97,7 @@ const TestInfo tests[] = {
 	{ "sort/query-sort-5", "sort/data-sort-4", FALSE },
 	{ "subqueries/subqueries-1", "subqueries/data-1", FALSE },
 	{ "subqueries/subqueries-union-1", "subqueries/data-1", FALSE },
+	{ "subqueries/subqueries-union-2", "subqueries/data-1", FALSE },
 	/* Bracket error after WHERE */
 	{ "error/query-error-1", "error/query-error-1", TRUE, FALSE },
 	/* Unknown property */



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