summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2022-03-10 23:56:17 +0100
committerCarlos Garnacho <carlosg@gnome.org>2022-03-13 14:45:44 +0100
commit0ad624703440e0fc4959cabe5069e49ea742b3d3 (patch)
tree5369fa5ab277625729abafe8ccadc84fc481015a /tests
parent4818044c215c315d0eaaca9b15ec279bd2b90981 (diff)
downloadtracker-0ad624703440e0fc4959cabe5069e49ea742b3d3.tar.gz
tests: Add more tests for cast and xpath functions
Diffstat (limited to 'tests')
-rw-r--r--tests/libtracker-data/functions/functions-cast-1.out1
-rw-r--r--tests/libtracker-data/functions/functions-cast-1.rq1
-rw-r--r--tests/libtracker-data/functions/functions-cast-2.out1
-rw-r--r--tests/libtracker-data/functions/functions-cast-2.rq1
-rw-r--r--tests/libtracker-data/functions/functions-xpath-15.out1
-rw-r--r--tests/libtracker-data/functions/functions-xpath-15.rq1
-rw-r--r--tests/libtracker-data/tracker-sparql-test.c3
7 files changed, 9 insertions, 0 deletions
diff --git a/tests/libtracker-data/functions/functions-cast-1.out b/tests/libtracker-data/functions/functions-cast-1.out
new file mode 100644
index 000000000..df71001e4
--- /dev/null
+++ b/tests/libtracker-data/functions/functions-cast-1.out
@@ -0,0 +1 @@
+"2.34" "2.34" "2" "2.34"
diff --git a/tests/libtracker-data/functions/functions-cast-1.rq b/tests/libtracker-data/functions/functions-cast-1.rq
new file mode 100644
index 000000000..7c540fdc7
--- /dev/null
+++ b/tests/libtracker-data/functions/functions-cast-1.rq
@@ -0,0 +1 @@
+SELECT xsd:string(2.34) rdf:langString(2.34) xsd:integer("2") xsd:double("2.34"@en) {}
diff --git a/tests/libtracker-data/functions/functions-cast-2.out b/tests/libtracker-data/functions/functions-cast-2.out
new file mode 100644
index 000000000..3e5e98562
--- /dev/null
+++ b/tests/libtracker-data/functions/functions-cast-2.out
@@ -0,0 +1 @@
+"1.0e3" "1000.0"
diff --git a/tests/libtracker-data/functions/functions-cast-2.rq b/tests/libtracker-data/functions/functions-cast-2.rq
new file mode 100644
index 000000000..fea7b55d6
--- /dev/null
+++ b/tests/libtracker-data/functions/functions-cast-2.rq
@@ -0,0 +1 @@
+SELECT xsd:string(1.0e3) xsd:double("1.0e3") {}
diff --git a/tests/libtracker-data/functions/functions-xpath-15.out b/tests/libtracker-data/functions/functions-xpath-15.out
new file mode 100644
index 000000000..695aebf78
--- /dev/null
+++ b/tests/libtracker-data/functions/functions-xpath-15.out
@@ -0,0 +1 @@
+"Don't change the h of hallo, it's a special one" "ḤELLO"
diff --git a/tests/libtracker-data/functions/functions-xpath-15.rq b/tests/libtracker-data/functions/functions-xpath-15.rq
new file mode 100644
index 000000000..54a3ba60e
--- /dev/null
+++ b/tests/libtracker-data/functions/functions-xpath-15.rq
@@ -0,0 +1 @@
+SELECT "Don't change the h of hallo, it's a special one" fn:upper-case ("\u1E25ello") {}
diff --git a/tests/libtracker-data/tracker-sparql-test.c b/tests/libtracker-data/tracker-sparql-test.c
index 8f4de201f..0a89e6527 100644
--- a/tests/libtracker-data/tracker-sparql-test.c
+++ b/tests/libtracker-data/tracker-sparql-test.c
@@ -122,6 +122,8 @@ const TestInfo tests[] = {
{ "expr-ops/query-unminus-1", "expr-ops/data", FALSE },
{ "expr-ops/query-unplus-1", "expr-ops/data", FALSE },
{ "expr-ops/query-res-1", "expr-ops/data", FALSE },
+ { "functions/functions-cast-1", "functions/data-1", FALSE },
+ { "functions/functions-cast-2", "functions/data-1", FALSE },
{ "functions/functions-property-1", "functions/data-1", FALSE },
{ "functions/functions-property-2", "functions/data-5", FALSE },
{ "functions/functions-tracker-1", "functions/data-1", FALSE },
@@ -148,6 +150,7 @@ const TestInfo tests[] = {
{ "functions/functions-xpath-12", "functions/data-4", FALSE },
{ "functions/functions-xpath-13", "functions/data-4", FALSE },
{ "functions/functions-xpath-14", "functions/data-4", FALSE },
+ { "functions/functions-xpath-15", "functions/data-1", FALSE },
{ "functions/functions-coalesce-1", "functions/data-1", FALSE },
{ "functions/functions-datatypes-1", "functions/data-1", FALSE },
{ "functions/functions-datatypes-2", "functions/data-2", FALSE },