aboutsummaryrefslogtreecommitdiff
path: root/tests/test
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-06-23 23:46:57 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2022-06-23 23:46:57 +0200
commit9c94e6ec731ce433aadf12eae22d50e8fec7a91b (patch)
treedc3db263ba5c2afc725c5d163460597f233c1c8d /tests/test
parentReformat test/datetime.scm (diff)
downloadcalp-9c94e6ec731ce433aadf12eae22d50e8fec7a91b.tar.gz
calp-9c94e6ec731ce433aadf12eae22d50e8fec7a91b.tar.xz
Remove (add|remove)-day, and month[+-].
Procedures where overly specific, and doing it manually was almost no more work.
Diffstat (limited to 'tests/test')
-rw-r--r--tests/test/datetime.scm28
-rw-r--r--tests/test/html/caltable.scm5
2 files changed, 4 insertions, 29 deletions
diff --git a/tests/test/datetime.scm b/tests/test/datetime.scm
index b2b97d45..f288bc4c 100644
--- a/tests/test/datetime.scm
+++ b/tests/test/datetime.scm
@@ -380,34 +380,6 @@
(datetime-max (datetime)
(datetime hour: 1)))
-;; month± mostly here for coverage,
-;; actual tests are for date±
-(test-equal "month+ dflt"
- (date month: 3 day: 1)
- (month+ (date month: 2 day: 1)))
-
-(test-equal "month+ given change"
- (date month: 4 day: 1)
- (month+ (date month: 2 day: 1) 2))
-
-(test-equal "month- dflt"
- (date month: 1 day: 1)
- (month- (date month: 2 day: 1)))
-
-(test-equal "month- given change"
- (date month: 2 day: 1)
- (month- (date month: 4 day: 1) 2))
-
-;; same for {add,remove}-day; mostly here for coverage.
-
-(test-equal "add-day"
- (date month: 1 day: 2)
- (add-day (date month: 1 day: 1)))
-
-(test-equal "remove-day"
- (date month: 1 day: 1)
- (remove-day (date month: 1 day: 2)))
-
;; TODO more week-number tests
(test-equal "Week 53"
53 (week-number #2020-12-28 mon))
diff --git a/tests/test/html/caltable.scm b/tests/test/html/caltable.scm
index d9eeca3e..f64f8775 100644
--- a/tests/test/html/caltable.scm
+++ b/tests/test/html/caltable.scm
@@ -101,5 +101,8 @@
(time (@ (datetime "2022-05-01")) 1)))
(parameterize ((week-start mon))
- (cal-table start-date: #2022-04-01 end-date: #2022-04-30 next-start: month+ prev-start: month-)))
+ (cal-table start-date: #2022-04-01
+ end-date: #2022-04-30
+ next-start: (lambda (d) (date+ d (date month: 1)))
+ prev-start: (lambda (d) (date- d (date month: 1))))))