reverting some date code

still not finished
This commit is contained in:
2021-09-30 20:02:06 +02:00
parent a199f10078
commit 3a3ac10a32
3 changed files with 40 additions and 31 deletions

View File

@@ -101,19 +101,19 @@
; it is in local time
(ut::define-test "result of (str-to-date \"01.01.1970\" \"%d.%m.%Y\")" '(ut::assert-equal -7200 (str-to-date "01.01.1970" "%d.%m.%Y")))
(ut::define-test "result of (date-add (str-to-date \"01.01.1970\" \"%d.%m.%Y\") 1 \"day\")" '(ut::assert-equal 79200 (date-add (str-to-date "01.01.1970" "%d.%m.%Y") 1 "day")))
(ut::define-test "result of (str-to-date \"01.01.1970\" \"%d.%m.%Y\")" '(ut::assert-equal 0 (str-to-date "01.01.1970" "%d.%m.%Y")))
(ut::define-test "result of (date-add (str-to-date \"01.01.1970\" \"%d.%m.%Y\") 1 \"day\")" '(ut::assert-equal 86400 (date-add (str-to-date "01.01.1970" "%d.%m.%Y") 1 "day")))
(ut::define-test "result of (start-of-day)" '(ut::assert-equal 1620856800 (start-of-day (str-to-date "2021-05-13 10:32:12" "%Y-%m-%d %H:%M:%S"))))
(ut::define-test "result of (end-of-day)" '(ut::assert-equal 1620943199 (end-of-day (str-to-date "2021-05-13 10:32:12" "%Y-%m-%d %H:%M:%S"))))
(ut::define-test "result of (start-of-month)" '(ut::assert-equal 1619820000 (start-of-month (str-to-date "2021-05-13 10:32:12" "%Y-%m-%d %H:%M:%S"))))
(ut::define-test "result of (end-of-month)" '(ut::assert-equal 1622498399 (end-of-month (str-to-date "2021-05-13 10:32:12" "%Y-%m-%d %H:%M:%S"))))
(ut::define-test "result of (start-of-next-month)" '(ut::assert-equal 1622498400 (start-of-next-month (str-to-date "2021-05-13 10:32:12" "%Y-%m-%d %H:%M:%S"))))
(ut::define-test "result of (end-of-next-month)" '(ut::assert-equal 1625176799 (end-of-next-month (str-to-date "2021-05-13 10:32:12" "%Y-%m-%d %H:%M:%S"))))
(ut::define-test "result of (start-of-prev-month)" '(ut::assert-equal 1617228000 (start-of-prev-month (str-to-date "2021-05-13 10:32:12" "%Y-%m-%d %H:%M:%S"))))
(ut::define-test "result of (end-of-prev-month)" '(ut::assert-equal 1619906399 (end-of-prev-month (str-to-date "2021-05-13 10:32:12" "%Y-%m-%d %H:%M:%S"))))
(ut::define-test "result of (start-of-year)" '(ut::assert-equal 1609452000 (start-of-year (str-to-date "2021-05-13 10:32:12" "%Y-%m-%d %H:%M:%S"))))
(ut::define-test "result of (end-of-year)" '(ut::assert-equal 1640987999 (end-of-year (str-to-date "2021-05-13 10:32:12" "%Y-%m-%d %H:%M:%S"))))
(ut::define-test "result of (start-of-day)" '(ut::assert-equal 1620864000 (start-of-day (str-to-date "2021-05-13 10:32:12" "%Y-%m-%d %H:%M:%S"))))
(ut::define-test "result of (end-of-day)" '(ut::assert-equal 1620950399 (end-of-day (str-to-date "2021-05-13 10:32:12" "%Y-%m-%d %H:%M:%S"))))
(ut::define-test "result of (start-of-month)" '(ut::assert-equal 1619827200 (start-of-month (str-to-date "2021-05-13 10:32:12" "%Y-%m-%d %H:%M:%S"))))
(ut::define-test "result of (end-of-month)" '(ut::assert-equal 1622505599 (end-of-month (str-to-date "2021-05-13 10:32:12" "%Y-%m-%d %H:%M:%S"))))
(ut::define-test "result of (start-of-next-month)" '(ut::assert-equal 1622505600 (start-of-next-month (str-to-date "2021-05-13 10:32:12" "%Y-%m-%d %H:%M:%S"))))
(ut::define-test "result of (end-of-next-month)" '(ut::assert-equal 1625097599 (end-of-next-month (str-to-date "2021-05-13 10:32:12" "%Y-%m-%d %H:%M:%S"))))
(ut::define-test "result of (start-of-prev-month)" '(ut::assert-equal 1617235200 (start-of-prev-month (str-to-date "2021-05-13 10:32:12" "%Y-%m-%d %H:%M:%S"))))
(ut::define-test "result of (end-of-prev-month)" '(ut::assert-equal 1619827199 (end-of-prev-month (str-to-date "2021-05-13 10:32:12" "%Y-%m-%d %H:%M:%S"))))
(ut::define-test "result of (start-of-year)" '(ut::assert-equal 1609459200 (start-of-year (str-to-date "2021-05-13 10:32:12" "%Y-%m-%d %H:%M:%S"))))
(ut::define-test "result of (end-of-year)" '(ut::assert-equal 1640995199 (end-of-year (str-to-date "2021-05-13 10:32:12" "%Y-%m-%d %H:%M:%S"))))
(ut::define-test "(read-file-lines \"/tmp/f.txt\" counter)" '(ut::assert-equal 3 (read-file-lines "/tmp/f.txt" counter)))