[tracker/wip/carlosg/more-tests: 4/12] tests: Add missing tests for SPARQL functions in the tracker namespace
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/wip/carlosg/more-tests: 4/12] tests: Add missing tests for SPARQL functions in the tracker namespace
- Date: Tue, 29 Sep 2020 13:51:10 +0000 (UTC)
commit ca32d64237ea6e8ad8099b4774141d94b83def22
Author: Carlos Garnacho <carlosg gnome org>
Date: Thu Sep 10 20:16:22 2020 +0200
tests: Add missing tests for SPARQL functions in the tracker namespace
.../functions/functions-tracker-3.out | 1 +
.../functions/functions-tracker-3.rq | 3 +++
.../functions/functions-tracker-4.out | 1 +
.../functions/functions-tracker-4.rq | 1 +
.../functions/functions-tracker-5.out | 1 +
.../functions/functions-tracker-5.rq | 1 +
.../functions/functions-tracker-6.out | 1 +
.../functions/functions-tracker-6.rq | 7 +++++++
.../functions/functions-tracker-7.out | 1 +
.../functions/functions-tracker-7.rq | 7 +++++++
.../functions/functions-tracker-8.out | 1 +
.../functions/functions-tracker-8.rq | 22 ++++++++++++++++++++++
tests/libtracker-data/tracker-sparql-test.c | 6 ++++++
13 files changed, 53 insertions(+)
---
diff --git a/tests/libtracker-data/functions/functions-tracker-3.out
b/tests/libtracker-data/functions/functions-tracker-3.out
new file mode 100644
index 000000000..826861551
--- /dev/null
+++ b/tests/libtracker-data/functions/functions-tracker-3.out
@@ -0,0 +1 @@
+"true"
diff --git a/tests/libtracker-data/functions/functions-tracker-3.rq
b/tests/libtracker-data/functions/functions-tracker-3.rq
new file mode 100644
index 000000000..718d4b1be
--- /dev/null
+++ b/tests/libtracker-data/functions/functions-tracker-3.rq
@@ -0,0 +1,3 @@
+SELECT ?eq {
+ BIND ((tracker:case-fold('AbCdEfGh') = tracker:case-fold('aBcDeFgH')) AS ?eq)
+}
diff --git a/tests/libtracker-data/functions/functions-tracker-4.out
b/tests/libtracker-data/functions/functions-tracker-4.out
new file mode 100644
index 000000000..b54d1763e
--- /dev/null
+++ b/tests/libtracker-data/functions/functions-tracker-4.out
@@ -0,0 +1 @@
+"abcd"
diff --git a/tests/libtracker-data/functions/functions-tracker-4.rq
b/tests/libtracker-data/functions/functions-tracker-4.rq
new file mode 100644
index 000000000..a4b94357d
--- /dev/null
+++ b/tests/libtracker-data/functions/functions-tracker-4.rq
@@ -0,0 +1 @@
+SELECT (tracker:ascii-lower-case ('ABCD') AS ?str) {}
diff --git a/tests/libtracker-data/functions/functions-tracker-5.out
b/tests/libtracker-data/functions/functions-tracker-5.out
new file mode 100644
index 000000000..35320426e
--- /dev/null
+++ b/tests/libtracker-data/functions/functions-tracker-5.out
@@ -0,0 +1 @@
+"aeiou"
diff --git a/tests/libtracker-data/functions/functions-tracker-5.rq
b/tests/libtracker-data/functions/functions-tracker-5.rq
new file mode 100644
index 000000000..17dd03004
--- /dev/null
+++ b/tests/libtracker-data/functions/functions-tracker-5.rq
@@ -0,0 +1 @@
+SELECT (tracker:unaccent ('áêïoù') AS ?str) {}
diff --git a/tests/libtracker-data/functions/functions-tracker-6.out
b/tests/libtracker-data/functions/functions-tracker-6.out
new file mode 100644
index 000000000..3c1dfc33e
--- /dev/null
+++ b/tests/libtracker-data/functions/functions-tracker-6.out
@@ -0,0 +1 @@
+"true" "false" "false" "false"
diff --git a/tests/libtracker-data/functions/functions-tracker-6.rq
b/tests/libtracker-data/functions/functions-tracker-6.rq
new file mode 100644
index 000000000..f7ed7f908
--- /dev/null
+++ b/tests/libtracker-data/functions/functions-tracker-6.rq
@@ -0,0 +1,7 @@
+SELECT
+ (tracker:uri-is-parent ('file:///', 'file:///a') AS ?a)
+ (tracker:uri-is-parent ('file:///a', 'file:///b') AS ?b)
+ (tracker:uri-is-parent ('file:///a', 'file:///') AS ?c)
+ (tracker:uri-is-parent ('file:///', 'file:///a/b') AS ?d)
+{
+}
diff --git a/tests/libtracker-data/functions/functions-tracker-7.out
b/tests/libtracker-data/functions/functions-tracker-7.out
new file mode 100644
index 000000000..e255b526a
--- /dev/null
+++ b/tests/libtracker-data/functions/functions-tracker-7.out
@@ -0,0 +1 @@
+"true" "false" "false" "true"
diff --git a/tests/libtracker-data/functions/functions-tracker-7.rq
b/tests/libtracker-data/functions/functions-tracker-7.rq
new file mode 100644
index 000000000..cdf10d716
--- /dev/null
+++ b/tests/libtracker-data/functions/functions-tracker-7.rq
@@ -0,0 +1,7 @@
+SELECT
+ (tracker:uri-is-descendant ('file:///', 'file:///a') AS ?a)
+ (tracker:uri-is-descendant ('file:///a', 'file:///b') AS ?b)
+ (tracker:uri-is-descendant ('file:///a', 'file:///') AS ?c)
+ (tracker:uri-is-descendant ('file:///', 'file:///a/b') AS ?d)
+{
+}
diff --git a/tests/libtracker-data/functions/functions-tracker-8.out
b/tests/libtracker-data/functions/functions-tracker-8.out
new file mode 100644
index 000000000..a16d4a495
--- /dev/null
+++ b/tests/libtracker-data/functions/functions-tracker-8.out
@@ -0,0 +1 @@
+"true" "true" "true" "true" "true" "true" "true" "true" "true" "true" "true" "true"
diff --git a/tests/libtracker-data/functions/functions-tracker-8.rq
b/tests/libtracker-data/functions/functions-tracker-8.rq
new file mode 100644
index 000000000..c874b731c
--- /dev/null
+++ b/tests/libtracker-data/functions/functions-tracker-8.rq
@@ -0,0 +1,22 @@
+SELECT
+ ?nfd1 ?nfd2 ?nfd3
+ ?nfc1 ?nfc2 ?nfc3
+ ?nfkd1 ?nfkd2 ?nfkd3
+ ?nfkc1 ?nfkc2 ?nfkc3
+{
+ # From http://www.unicode.org/reports/tr15/#Compatibility_Composite_Figure
+ BIND ((tracker:normalize ('\ufb01', 'nfd') = '\ufb01') AS ?nfd1) .
+ BIND ((tracker:normalize ('\ufb01', 'nfc') = '\ufb01') AS ?nfc1) .
+ BIND ((tracker:normalize ('\ufb01', 'nfkd') = '\u0066\u0069') AS ?nfkd1) .
+ BIND ((tracker:normalize ('\ufb01', 'nfkc') = '\u0066\u0069') AS ?nfkc1) .
+
+ BIND ((tracker:normalize ('\u0032\u2075', 'nfd') = '\u0032\u2075') AS ?nfd2) .
+ BIND ((tracker:normalize ('\u0032\u2075', 'nfc') = '\u0032\u2075') AS ?nfc2) .
+ BIND ((tracker:normalize ('\u0032\u2075', 'nfkd') = '\u0032\u0035') AS ?nfkd2) .
+ BIND ((tracker:normalize ('\u0032\u2075', 'nfkc') = '\u0032\u0035') AS ?nfkc2) .
+
+ BIND ((tracker:normalize ('\u1e9b\u0323', 'nfd') = '\u017f\u0323\u0307') AS ?nfd3) .
+ BIND ((tracker:normalize ('\u1e9b\u0323', 'nfc') = '\u1e9b\u0323') AS ?nfc3) .
+ BIND ((tracker:normalize ('\u1e9b\u0323', 'nfkd') = '\u0073\u0323\u0307') AS ?nfkd3) .
+ BIND ((tracker:normalize ('\u1e9b\u0323', 'nfkc') = '\u1e69') AS ?nfkc3) .
+}
diff --git a/tests/libtracker-data/tracker-sparql-test.c b/tests/libtracker-data/tracker-sparql-test.c
index 73bd93dd1..ba9ecdd8c 100644
--- a/tests/libtracker-data/tracker-sparql-test.c
+++ b/tests/libtracker-data/tracker-sparql-test.c
@@ -114,6 +114,12 @@ const TestInfo tests[] = {
{ "functions/functions-property-1", "functions/data-1", FALSE },
{ "functions/functions-tracker-1", "functions/data-1", FALSE },
{ "functions/functions-tracker-2", "functions/data-2", FALSE },
+ { "functions/functions-tracker-3", "functions/data-2", FALSE },
+ { "functions/functions-tracker-4", "functions/data-2", FALSE },
+ { "functions/functions-tracker-5", "functions/data-2", FALSE },
+ { "functions/functions-tracker-6", "functions/data-2", FALSE },
+ { "functions/functions-tracker-7", "functions/data-2", FALSE },
+ { "functions/functions-tracker-8", "functions/data-2", FALSE },
{ "functions/functions-tracker-loc-1", "functions/data-3", FALSE },
{ "functions/functions-xpath-1", "functions/data-1", FALSE },
{ "functions/functions-xpath-2", "functions/data-1", FALSE },
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]