Basic cal-day tests.

This commit is contained in:
Dominik Pantůček 2023-05-10 17:40:48 +02:00
parent ece84932d1
commit 244b7d8c25

View file

@ -118,6 +118,32 @@
(define (cal-day-tests!) (define (cal-day-tests!)
(run-tests (run-tests
cal-day cal-day
(test-equal? make-cal-day
(make-cal-day 2023 5 10)
`(,TAG-CAL-DAY 2023 5 10))
(test-true cal-year-leap?
(cal-year-leap? 2000))
(test-true cal-year-leap?
(cal-year-leap? 2024))
(test-false cal-year-leap?
(cal-year-leap? 2023))
(test-false cal-year-leap?
(cal-year-leap? 1900))
(test-eq? cal-month-days
(cal-month-days 2023 5)
31)
(test-eq? cal-month-days
(cal-month-days 2023 2)
28)
(test-eq? cal-month-days
(cal-month-days 2024 2)
29)
(test-true cal-day?
(cal-day? (make-cal-day 2023 5 10)))
(test-false cal-day?
(cal-day? (make-cal-day 2023 2 29)))
(test-true cal-day?
(cal-day? (make-cal-day 2024 2 29)))
)) ))
) )