From 244b7d8c258721c5b4ca07bbbefa2ac699cf3cb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Pant=C5=AF=C4=8Dek?= Date: Wed, 10 May 2023 17:40:48 +0200 Subject: [PATCH] Basic cal-day tests. --- src/cal-day.scm | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/cal-day.scm b/src/cal-day.scm index c796114..120df80 100644 --- a/src/cal-day.scm +++ b/src/cal-day.scm @@ -118,6 +118,32 @@ (define (cal-day-tests!) (run-tests 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))) )) )