Fix period tests with error reporting.
This commit is contained in:
parent
4b26c653d9
commit
019136319f
1 changed files with 14 additions and 6 deletions
20
period.scm
20
period.scm
|
@ -75,7 +75,9 @@
|
||||||
(rmt (if cb 'stop 'start))
|
(rmt (if cb 'stop 'start))
|
||||||
(mtype (car marker))
|
(mtype (car marker))
|
||||||
(month (cadr marker))
|
(month (cadr marker))
|
||||||
(line-number (caddr marker)))
|
(line-number (if (null? (cddr marker))
|
||||||
|
#f
|
||||||
|
(caddr marker))))
|
||||||
(if (eq? mtype rmt)
|
(if (eq? mtype rmt)
|
||||||
(if cb
|
(if cb
|
||||||
(loop (cdr l)
|
(loop (cdr l)
|
||||||
|
@ -161,14 +163,20 @@
|
||||||
(test-equal? period-markers->periods
|
(test-equal? period-markers->periods
|
||||||
(period-markers->periods
|
(period-markers->periods
|
||||||
'((start (2022 3)) (stop (2022 10)) (start (2023 1)) (stop (2023 4))))
|
'((start (2022 3)) (stop (2022 10)) (start (2023 1)) (stop (2023 4))))
|
||||||
'(((2022 3) . (2022 10))
|
'(#t
|
||||||
((2023 1) . (2023 4))))
|
(((2022 3) . (2022 10))
|
||||||
|
((2023 1) . (2023 4)))
|
||||||
|
""
|
||||||
|
-1))
|
||||||
(test-equal? period-markers->periods-open
|
(test-equal? period-markers->periods-open
|
||||||
(period-markers->periods
|
(period-markers->periods
|
||||||
'((start (2022 3)) (stop (2022 10)) (start (2023 1)) (stop (2023 4)) (start (2023 5))))
|
'((start (2022 3)) (stop (2022 10)) (start (2023 1)) (stop (2023 4)) (start (2023 5))))
|
||||||
'(((2022 3) . (2022 10))
|
'(#t
|
||||||
((2023 1) . (2023 4))
|
(((2022 3) . (2022 10))
|
||||||
((2023 5) . #f)))
|
((2023 1) . (2023 4))
|
||||||
|
((2023 5) . #f))
|
||||||
|
""
|
||||||
|
-1))
|
||||||
(test-eq? period-duration
|
(test-eq? period-duration
|
||||||
(period->duration '((2023 1) . (2023 4))) 3)
|
(period->duration '((2023 1) . (2023 4))) 3)
|
||||||
(parameterize ((*current-month* (list 2023 4)))
|
(parameterize ((*current-month* (list 2023 4)))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue