From 019136319ff77974bd7aa32c1c9e14d5955558ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Pant=C5=AF=C4=8Dek?= Date: Mon, 20 Mar 2023 20:53:02 +0100 Subject: [PATCH] Fix period tests with error reporting. --- period.scm | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/period.scm b/period.scm index c5cd08f..a02b902 100644 --- a/period.scm +++ b/period.scm @@ -75,7 +75,9 @@ (rmt (if cb 'stop 'start)) (mtype (car marker)) (month (cadr marker)) - (line-number (caddr marker))) + (line-number (if (null? (cddr marker)) + #f + (caddr marker)))) (if (eq? mtype rmt) (if cb (loop (cdr l) @@ -161,14 +163,20 @@ (test-equal? period-markers->periods (period-markers->periods '((start (2022 3)) (stop (2022 10)) (start (2023 1)) (stop (2023 4)))) - '(((2022 3) . (2022 10)) - ((2023 1) . (2023 4)))) + '(#t + (((2022 3) . (2022 10)) + ((2023 1) . (2023 4))) + "" + -1)) (test-equal? period-markers->periods-open (period-markers->periods '((start (2022 3)) (stop (2022 10)) (start (2023 1)) (stop (2023 4)) (start (2023 5)))) - '(((2022 3) . (2022 10)) - ((2023 1) . (2023 4)) - ((2023 5) . #f))) + '(#t + (((2022 3) . (2022 10)) + ((2023 1) . (2023 4)) + ((2023 5) . #f)) + "" + -1)) (test-eq? period-duration (period->duration '((2023 1) . (2023 4))) 3) (parameterize ((*current-month* (list 2023 4)))