[tracker] tests, libtracker-data: Added unit tests for Unicode lower-case and case-fold



commit c505ba761ccc495718da307f9afd92d8c3bd7f4a
Author: Philip Van Hoof <philip codeminded be>
Date:   Wed Mar 30 17:44:27 2011 +0200

    tests, libtracker-data: Added unit tests for Unicode lower-case and case-fold

 tests/libtracker-data/functions/Makefile.am        |    8 +++++++-
 .../functions/functions-xpath-7.out                |    5 +++++
 .../libtracker-data/functions/functions-xpath-7.rq |    9 +++++++++
 .../functions/functions-xpath-8.out                |    5 +++++
 .../libtracker-data/functions/functions-xpath-8.rq |    8 ++++++++
 .../functions/functions-xpath-9.out                |    1 +
 .../libtracker-data/functions/functions-xpath-9.rq |    3 +++
 tests/libtracker-data/tracker-sparql-test.c        |    3 +++
 8 files changed, 41 insertions(+), 1 deletions(-)
---
diff --git a/tests/libtracker-data/functions/Makefile.am b/tests/libtracker-data/functions/Makefile.am
index df7071e..2b36f4c 100644
--- a/tests/libtracker-data/functions/Makefile.am
+++ b/tests/libtracker-data/functions/Makefile.am
@@ -26,4 +26,10 @@ EXTRA_DIST =                                           \
 	functions-xpath-5.out                          \
 	functions-xpath-5.rq                           \
 	functions-xpath-6.rq                           \
-	functions-xpath-6.out
+	functions-xpath-6.out                          \
+	functions-xpath-7.rq                           \
+	functions-xpath-7.out                          \
+	functions-xpath-8.rq                           \
+	functions-xpath-8.out                          \
+	functions-xpath-9.rq                           \
+	functions-xpath-9.out
diff --git a/tests/libtracker-data/functions/functions-xpath-7.out b/tests/libtracker-data/functions/functions-xpath-7.out
new file mode 100644
index 0000000..08cad02
--- /dev/null
+++ b/tests/libtracker-data/functions/functions-xpath-7.out
@@ -0,0 +1,5 @@
+"for"
+"purposes"
+"test"
+"testing"
+"text"
diff --git a/tests/libtracker-data/functions/functions-xpath-7.rq b/tests/libtracker-data/functions/functions-xpath-7.rq
new file mode 100644
index 0000000..4b305bb
--- /dev/null
+++ b/tests/libtracker-data/functions/functions-xpath-7.rq
@@ -0,0 +1,9 @@
+PREFIX ex: <http://example/>
+PREFIX fn: <http://www.w3.org/2005/xpath-functions#>
+
+SELECT
+  tracker:ascii-lower-case(?t)
+
+WHERE {
+  ?_x ex:t ?t .
+} ORDER BY ?t
diff --git a/tests/libtracker-data/functions/functions-xpath-8.out b/tests/libtracker-data/functions/functions-xpath-8.out
new file mode 100644
index 0000000..6695b79
--- /dev/null
+++ b/tests/libtracker-data/functions/functions-xpath-8.out
@@ -0,0 +1,5 @@
+"for"
+"purposes"
+"Test"
+"testing"
+"Text"
diff --git a/tests/libtracker-data/functions/functions-xpath-8.rq b/tests/libtracker-data/functions/functions-xpath-8.rq
new file mode 100644
index 0000000..fbcf153
--- /dev/null
+++ b/tests/libtracker-data/functions/functions-xpath-8.rq
@@ -0,0 +1,8 @@
+PREFIX ex: <http://example/>
+PREFIX fn: <http://www.w3.org/2005/xpath-functions#>
+
+SELECT ?t
+WHERE {
+  ?_x ex:t ?t .
+  filter (tracker:case-fold (?t) = tracker:case-fold(fn:lower-case (?t)))
+} ORDER BY ?t
diff --git a/tests/libtracker-data/functions/functions-xpath-9.out b/tests/libtracker-data/functions/functions-xpath-9.out
new file mode 100644
index 0000000..4f6e611
--- /dev/null
+++ b/tests/libtracker-data/functions/functions-xpath-9.out
@@ -0,0 +1 @@
+"ḥello"
diff --git a/tests/libtracker-data/functions/functions-xpath-9.rq b/tests/libtracker-data/functions/functions-xpath-9.rq
new file mode 100644
index 0000000..fc186b1
--- /dev/null
+++ b/tests/libtracker-data/functions/functions-xpath-9.rq
@@ -0,0 +1,3 @@
+PREFIX fn: <http://www.w3.org/2005/xpath-functions#>
+
+SELECT fn:lower-case ("\u1E24ello") {}
diff --git a/tests/libtracker-data/tracker-sparql-test.c b/tests/libtracker-data/tracker-sparql-test.c
index 3f50619..1062d20 100644
--- a/tests/libtracker-data/tracker-sparql-test.c
+++ b/tests/libtracker-data/tracker-sparql-test.c
@@ -93,6 +93,9 @@ const TestInfo tests[] = {
 	{ "functions/functions-xpath-4", "functions/data-1", FALSE },
 	{ "functions/functions-xpath-5", "functions/data-1", FALSE },
 	{ "functions/functions-xpath-6", "functions/data-1", FALSE },
+	{ "functions/functions-xpath-7", "functions/data-1", FALSE },
+	{ "functions/functions-xpath-8", "functions/data-1", FALSE },
+	{ "functions/functions-xpath-9", "functions/data-1", FALSE },
 	{ "graph/graph-1", "graph/data-1", FALSE },
 	{ "graph/graph-2", "graph/data-2", FALSE },
 	{ "graph/graph-3", "graph/data-3", FALSE },



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