aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@hornquist.se>2020-02-14 00:19:05 +0100
committerHugo Hörnquist <hugo@hornquist.se>2020-02-14 00:19:53 +0100
commit30357bc117aee20b7f43ec40fe5551930a0bf7d3 (patch)
tree6a33cff2426c7c94d8caa8b62edb93cb2574d881 /tests
parentMove stream-null? in group-stream. (diff)
downloadcalp-30357bc117aee20b7f43ec40fe5551930a0bf7d3.tar.gz
calp-30357bc117aee20b7f43ec40fe5551930a0bf7d3.tar.xz
Add datetime-difference.
Diffstat (limited to 'tests')
-rw-r--r--tests/srfi-19-alt.scm22
1 files changed, 19 insertions, 3 deletions
diff --git a/tests/srfi-19-alt.scm b/tests/srfi-19-alt.scm
index 1a351992..51419fcc 100644
--- a/tests/srfi-19-alt.scm
+++ b/tests/srfi-19-alt.scm
@@ -6,10 +6,15 @@
datetime+
datetime-
datetime<=?
+ datetime-difference
+ leap-year?
)
((ice-9 format) format)
)
+(test-equal "empty time"
+ (time) #00:00:00)
+
(test-assert "Synatx date"
#2020-01-01)
@@ -91,9 +96,9 @@
#00:00:00
(time- #10:20:30 #10:20:30))
-(test-equal "date- self"
- #0000-00-00
- (date- #2020-01-01 #2020-01-01))
+(test-equal "datetime-difference self"
+ #0000-00-00T00:00:00
+ (datetime-difference (datetime date: #2020-01-01) (datetime date: #2020-01-01)))
;; (test-assert
;; (datetime- #2018-01-17T10:00:00
@@ -105,3 +110,14 @@
;; (datetime- #2018-01-17T10:00:00
;; #2018-01-17T08:00:00)))
+
+;; TODO
+;; at the time of writing this returns #2020-02-00
+;; The general question is, how is the last in a month handled?
+;; (test-equal
+;; (date+ #2019-12-31 (date month: 1)))
+
+(test-assert (leap-year? 2020))
+
+(test-equal "Add to Leap day"
+ #2020-02-29 (date+ #2020-02-28 (date day: 1)))