[tracker/wip/carlosg/more-tests] tests: Add more tests for cast and xpath functions




commit 044acbf1255421b8eb0495bd09ce96e45bfd4dbf
Author: Carlos Garnacho <carlosg gnome org>
Date:   Thu Mar 10 23:56:17 2022 +0100

    tests: Add more tests for cast and xpath functions

 tests/libtracker-data/functions/functions-cast-1.out   | 1 +
 tests/libtracker-data/functions/functions-cast-1.rq    | 1 +
 tests/libtracker-data/functions/functions-cast-2.out   | 1 +
 tests/libtracker-data/functions/functions-cast-2.rq    | 1 +
 tests/libtracker-data/functions/functions-xpath-15.out | 1 +
 tests/libtracker-data/functions/functions-xpath-15.rq  | 1 +
 tests/libtracker-data/tracker-sparql-test.c            | 2 ++
 7 files changed, 8 insertions(+)
---
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 2975bb066..b9c953715 100644
--- a/tests/libtracker-data/tracker-sparql-test.c
+++ b/tests/libtracker-data/tracker-sparql-test.c
@@ -122,6 +122,7 @@ 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-property-1", "functions/data-1", FALSE },
        { "functions/functions-property-2", "functions/data-5", FALSE },
        { "functions/functions-tracker-1", "functions/data-1", FALSE },
@@ -148,6 +149,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 },


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