aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-05-18 00:19:32 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2022-05-18 00:19:32 +0200
commit7e55e74249e38e863254e3dd9263db2b907dca9d (patch)
tree5f79b99ae7e0ef6b28f21984c4159b6da771f962
parentAdd procedure realpath. (diff)
downloadcalp-7e55e74249e38e863254e3dd9263db2b907dca9d.tar.gz
calp-7e55e74249e38e863254e3dd9263db2b907dca9d.tar.xz
Possibly marginally improve tests.
-rw-r--r--tests/test/datetime.scm76
1 files changed, 20 insertions, 56 deletions
diff --git a/tests/test/datetime.scm b/tests/test/datetime.scm
index 8648006b..3435aad6 100644
--- a/tests/test/datetime.scm
+++ b/tests/test/datetime.scm
@@ -15,72 +15,36 @@
:use-module ((guile) :select (LC_CTYPE LC_TIME)))
(test-equal
- "empty time"
+ "A new time is empty"
(time)
#00:00:00)
-(test-assert
- "Synatx date"
- #2020-01-01)
-
-(test-assert
- "Test year type"
- (integer? (year (date year: 2020))))
-
-(test-assert
- "Test mmnth type"
- (integer? (month (date month: 1))))
+(test-equal "A new date is empty"
+ (date)
+ #0000-00-00)
(test-assert
- "Test day type"
- (integer? (day (date day: 1))))
-
-(test-equal
- "Manual print (any)"
- "2020-10-10"
- (let ((d #2020-10-10))
- (format #f "~a-~a-~a" (year d) (month d) (day d))))
-
-(test-equal
- "Manual print (number)"
- "2020-10-10"
- (let ((d #2020-10-10))
- (format #f "~d-~d-~d" (year d) (month d) (day d))))
-
-(test-equal
- "Date print"
- "#2020-01-01"
- (format
- #f
- "~a"
- #2020-01-01))
-
-(test-equal "time print"
- "#20:30:40"
- (format #f "~a" #20:30:40))
+ "Datetime have syntax"
+ #2020-01-01)
-(test-equal "time print bad"
- "#<<time> hour=#f minute=1 second=2>"
- (format #f "~a" (time hour: #f
- minute: 1
- second: 2)))
-(test-equal
- "Syntax date="
- (date year: 2020 month: 1 day: 1)
- #2020-01-01)
+(test-group "The syntax for <> is equivalent to manually creating them"
+ (test-equal
+ "dates"
+ (date year: 2020 month: 1 day: 1)
+ #2020-01-01)
-(test-equal
- "Syntax time="
- (time hour: 13 minute: 37 second: 0)
- #13:37:00)
+ (test-equal
+ "times"
+ (time hour: 13 minute: 37 second: 0)
+ #13:37:00)
-(test-equal
- "Syntax Datetime="
- (datetime year: 2020 month: 1 day: 1
- hour: 13 minute: 37 second: 0)
- #2020-01-01T13:37:00)
+ (test-equal
+ "datetimes"
+ (datetime year: 2020 month: 1 day: 1
+ hour: 13 minute: 37 second: 0)
+ #2020-01-01T13:37:00))
(test-equal
"Date- over leap year month shift"