[tracker/wip/carlosg/datetime-fixes: 5/5] tests: Add some tests for dates far in the past/future




commit d48fb81d7a557d3facb241622a8298cd709115ec
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sat Oct 10 14:29:41 2020 +0200

    tests: Add some tests for dates far in the past/future
    
    To ensure these work as intended.

 tests/libtracker-data/datetime/data-4.rq    | 4 ++++
 tests/libtracker-data/datetime/direct-1.out | 1 +
 tests/libtracker-data/datetime/direct-1.rq  | 1 +
 tests/libtracker-data/datetime/insert-1.out | 1 +
 tests/libtracker-data/datetime/insert-1.rq  | 4 ++++
 tests/libtracker-data/tracker-sparql-test.c | 2 ++
 6 files changed, 13 insertions(+)
---
diff --git a/tests/libtracker-data/datetime/data-4.rq b/tests/libtracker-data/datetime/data-4.rq
new file mode 100644
index 000000000..0cd6f339b
--- /dev/null
+++ b/tests/libtracker-data/datetime/data-4.rq
@@ -0,0 +1,4 @@
+INSERT {
+       example:x a example:A ;
+          example:p "0100-12-31T21:00:00-03:00"
+}
diff --git a/tests/libtracker-data/datetime/direct-1.out b/tests/libtracker-data/datetime/direct-1.out
new file mode 100644
index 000000000..566938b9d
--- /dev/null
+++ b/tests/libtracker-data/datetime/direct-1.out
@@ -0,0 +1 @@
+"0000-01-01T00:00:00Z" "2020-01-01T00:00:00Z"  "9999-01-01T00:00:00Z"
diff --git a/tests/libtracker-data/datetime/direct-1.rq b/tests/libtracker-data/datetime/direct-1.rq
new file mode 100644
index 000000000..51de51070
--- /dev/null
+++ b/tests/libtracker-data/datetime/direct-1.rq
@@ -0,0 +1 @@
+SELECT ("0000-01-01T00:00:00Z"^^xsd:dateTime AS ?d1) ("2020-01-01T00:00:00Z"^^xsd:dateTime AS ?d2) 
("9999-01-01T00:00:00Z"^^xsd:dateTime AS ?d3) {}
\ No newline at end of file
diff --git a/tests/libtracker-data/datetime/insert-1.out b/tests/libtracker-data/datetime/insert-1.out
new file mode 100644
index 000000000..7dcd21192
--- /dev/null
+++ b/tests/libtracker-data/datetime/insert-1.out
@@ -0,0 +1 @@
+"http://example/x";     "0100-12-31T21:00:00-03:00"
diff --git a/tests/libtracker-data/datetime/insert-1.rq b/tests/libtracker-data/datetime/insert-1.rq
new file mode 100644
index 000000000..6c2e0a01c
--- /dev/null
+++ b/tests/libtracker-data/datetime/insert-1.rq
@@ -0,0 +1,4 @@
+SELECT ?s ?v
+WHERE {
+       ?s example:p ?v
+}
diff --git a/tests/libtracker-data/tracker-sparql-test.c b/tests/libtracker-data/tracker-sparql-test.c
index 4024e105a..9f4d68fc9 100644
--- a/tests/libtracker-data/tracker-sparql-test.c
+++ b/tests/libtracker-data/tracker-sparql-test.c
@@ -92,7 +92,9 @@ const TestInfo tests[] = {
        { "construct/construct-where", "construct/data", FALSE },
        { "construct/construct-pattern", "construct/data", FALSE },
        { "construct/construct-with-modifiers", "construct/data", FALSE },
+       { "datetime/direct-1", "datetime/data-1", FALSE },
        { "datetime/delete-1", "datetime/data-3", FALSE },
+       { "datetime/insert-1", "datetime/data-4", FALSE },
        { "datetime/functions-localtime-1", "datetime/data-1", FALSE },
        { "datetime/functions-timezone-1", "datetime/data-2", FALSE },
        { "datetime/functions-timezone-2", "datetime/data-2", FALSE },


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