[tracker/wip/carlosg/fixes-for-dataobject-split: 2/8] tests: Add tests for insertion of dates with UTC offsets



commit fa80354dfe31f3b208aa1fe69a326178176f855b
Author: Carlos Garnacho <carlosg gnome org>
Date:   Thu Apr 23 11:28:30 2020 +0200

    tests: Add tests for insertion of dates with UTC offsets
    
    We must preserve those, and not fail on the way. This test would
    trigger the warning fixed in the previous commit.

 tests/libtracker-data/tracker-sparql-test.c                | 1 +
 tests/libtracker-data/update/insert-date-with-offset-1.rq  | 3 +++
 tests/libtracker-data/update/select-date-with-offset-1.out | 2 ++
 tests/libtracker-data/update/select-date-with-offset-1.rq  | 4 ++++
 tests/libtracker-data/update/test.ontology                 | 6 ++++++
 5 files changed, 16 insertions(+)
---
diff --git a/tests/libtracker-data/tracker-sparql-test.c b/tests/libtracker-data/tracker-sparql-test.c
index f4864b8b0..c044f9f0f 100644
--- a/tests/libtracker-data/tracker-sparql-test.c
+++ b/tests/libtracker-data/tracker-sparql-test.c
@@ -252,6 +252,7 @@ const TestInfo tests[] = {
        { "update/delete-insert-where-query-4", "update/delete-insert-where-4", FALSE, FALSE },
        { "update/delete-insert-where-query-5", "update/delete-insert-where-5", FALSE, FALSE },
        { "update/delete-insert-where-query-6", "update/delete-insert-where-6", FALSE, FALSE },
+       { "update/select-date-with-offset-1", "update/insert-date-with-offset-1", FALSE, FALSE },
        { NULL }
 };
 
diff --git a/tests/libtracker-data/update/insert-date-with-offset-1.rq 
b/tests/libtracker-data/update/insert-date-with-offset-1.rq
new file mode 100644
index 000000000..592e42b23
--- /dev/null
+++ b/tests/libtracker-data/update/insert-date-with-offset-1.rq
@@ -0,0 +1,3 @@
+INSERT DATA {
+  example:predefined example:date "2001-01-01T05:01:00-02:00" .
+}
diff --git a/tests/libtracker-data/update/select-date-with-offset-1.out 
b/tests/libtracker-data/update/select-date-with-offset-1.out
new file mode 100644
index 000000000..d11948b9b
--- /dev/null
+++ b/tests/libtracker-data/update/select-date-with-offset-1.out
@@ -0,0 +1,2 @@
+"2001-01-01T01:01:01+02:00"
+"2001-01-01T05:01:00-02:00"
diff --git a/tests/libtracker-data/update/select-date-with-offset-1.rq 
b/tests/libtracker-data/update/select-date-with-offset-1.rq
new file mode 100644
index 000000000..a3d27ebc4
--- /dev/null
+++ b/tests/libtracker-data/update/select-date-with-offset-1.rq
@@ -0,0 +1,4 @@
+SELECT ?date {
+  ?u example:date ?date
+}
+ORDER BY ?date
diff --git a/tests/libtracker-data/update/test.ontology b/tests/libtracker-data/update/test.ontology
index 638399223..d7aac1574 100644
--- a/tests/libtracker-data/update/test.ontology
+++ b/tests/libtracker-data/update/test.ontology
@@ -34,3 +34,9 @@ example:stringMultivalued a rdf:Property ;
         rdfs:domain example:A ;
         rdfs:range xsd:string .
 
+example:date a rdf:Property ;
+       rdfs:domain example:A ;
+       rdfs:range xsd:dateTime .
+
+example:predefined a example:A ;
+       example:date "2001-01-01T01:01:01+02:00" .


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