Basic cal-day tests.
This commit is contained in:
parent
ece84932d1
commit
244b7d8c25
1 changed files with 26 additions and 0 deletions
|
@ -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)))
|
||||||
))
|
))
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue