diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-10-02 19:26:40 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-10-02 19:28:44 +0200 |
commit | 712654d4c023a2ab13190c6905d313e0ba897965 (patch) | |
tree | b8505b420d6621022fa6a46271340071d8881322 /tests/test/tz.scm | |
parent | Made displayln into a library export. (diff) | |
download | calp-712654d4c023a2ab13190c6905d313e0ba897965.tar.gz calp-712654d4c023a2ab13190c6905d313e0ba897965.tar.xz |
Rewrite test running system.
Diffstat (limited to 'tests/test/tz.scm')
-rw-r--r-- | tests/test/tz.scm | 87 |
1 files changed, 0 insertions, 87 deletions
diff --git a/tests/test/tz.scm b/tests/test/tz.scm deleted file mode 100644 index 00a611b3..00000000 --- a/tests/test/tz.scm +++ /dev/null @@ -1,87 +0,0 @@ -;;; Commentary: -;; Tests that datetime->unix-time correctly converts between Olssen -;; timezone definitions (e.g. Europe/Stockholm), into correct times -;; and offsets (in unix time). -;; Also indirectly tests the Zone Info Compiler (datetime zic), since -;; the zoneinfo comes from there. -;;; Code: - -(define-module (test tz) - :use-module (srfi srfi-64) - :use-module (srfi srfi-88) - :use-module ((datetime) - :select (parse-ics-datetime - datetime - date - time - datetime->unix-time - unix-time->datetime - get-datetime)) - :use-module ((hnh util env) :select (let-env))) - -;; London alternates between +0000 and +0100 -(let-env - ((TZ "Europe/London")) - (test-equal - "London winter" - #2020-01-12T13:30:00 - (get-datetime - (parse-ics-datetime "20200112T133000Z"))) - (test-equal - "London summer" - #2020-06-12T14:30:00 - (get-datetime - (parse-ics-datetime "20200612T133000Z")))) - -;; Stockholm alternates between +0100 and +0200 -(let-env - ((TZ "Europe/Stockholm")) - (test-equal - "Stockholm winter" - #2020-01-12T14:30:00 - (get-datetime - (parse-ics-datetime "20200112T133000Z"))) - (test-equal - "Stockholm summer" - #2020-06-12T15:30:00 - (get-datetime - (parse-ics-datetime "20200612T133000Z")))) - -(test-equal - -10800 - (datetime->unix-time - (parse-ics-datetime - "19700101T000000" - "Europe/Tallinn"))) - -(test-equal - -3600 - (datetime->unix-time - (parse-ics-datetime - "19700101T000000" - "Europe/Stockholm"))) - -(test-equal - 0 - (datetime->unix-time - (parse-ics-datetime "19700101T000000Z"))) - -;; yes, really -(test-equal - -3600 - (datetime->unix-time - (parse-ics-datetime - "19700101T000000" - "Europe/London"))) - -(test-equal - (datetime - date: - #1970-01-01 - time: - #00:00:00 - tz: - "UTC") - (unix-time->datetime 0)) - - |