diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2020-09-10 20:16:22 +0200 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2020-09-30 13:07:37 +0200 |
commit | 47c2a7f56a00f1e1d992f875f7542e97ca28a92a (patch) | |
tree | f1b45592abc8b084d5049d60034ee2f37bfdf8e2 | |
parent | d153c94f75005adb1ffdb447f7d3ef78daf9e0c6 (diff) | |
download | tracker-47c2a7f56a00f1e1d992f875f7542e97ca28a92a.tar.gz |
tests: Add missing tests for SPARQL functions in the tracker namespace
13 files changed, 53 insertions, 0 deletions
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 }, |