aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2021-12-06 03:55:47 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2021-12-06 03:55:47 +0100
commit8e93d53e6665e6ad782f94911032f043f9377ca4 (patch)
treeb52f1ed8ab2a9a9b490d57e13bd89ed2a8d556ec /tests
parentAdd clarifying comments. (diff)
downloadcalp-8e93d53e6665e6ad782f94911032f043f9377ca4.tar.gz
calp-8e93d53e6665e6ad782f94911032f043f9377ca4.tar.xz
Update xcal rrule parser to do as expected.
Diffstat (limited to 'tests')
-rw-r--r--tests/recurrence-simple.scm27
1 files changed, 26 insertions, 1 deletions
diff --git a/tests/recurrence-simple.scm b/tests/recurrence-simple.scm
index 166fa349..bbe6dd9d 100644
--- a/tests/recurrence-simple.scm
+++ b/tests/recurrence-simple.scm
@@ -9,7 +9,7 @@
((vcomponent base) extract prop)
((calp util exceptions) warnings-are-errors warning-handler)
- ((guile) format)
+ ((guile) format @@)
((vcomponent) parse-calendar)
((vcomponent xcal parse) sxcal->vcomponent)
@@ -242,6 +242,13 @@ END:VCALENDAR"
;;; Earlier I failed to actually parse the recurrence parts, in short, 1 ≠ "1".
+(test-assert "Test that xcal recur rules are parseable"
+ ((@@ (vcomponent xcal parse) handle-value)
+ 'recur 'props-are-unused-for-recur
+ '((freq "WEEKLY")
+ (interval "1")
+ (wkst "MO"))))
+
(define ev
(sxcal->vcomponent
'(vevent
@@ -260,3 +267,21 @@ END:VCALENDAR"
(test-assert
"Check that recurrence rule commint from xcal also works"
(generate-recurrence-set ev))
+
+;;; TODO test here, for byday parsing, and multiple byday instances in one recur element
+;;; TODO which should also test serializing and deserializing to xcal.
+;;; For example, the following rules specify every workday
+
+;; BEGIN:VCALENDAR
+;; PRODID:-//hugo//calp 0.6.1//EN
+;; VERSION:2.0
+;; CALSCALE:GREGORIAN
+;; BEGIN:VEVENT
+;; SUMMARY:Lunch
+;; DTSTART:20211129T133000
+;; DTEND:20211129T150000
+;; LAST-MODIFIED:20211204T220944Z
+;; UID:3d82c73c-6cdb-4799-beba-5f1d20d55347
+;; RRULE:FREQ=DAILY;BYDAY=MO,TU,WE,TH,FR
+;; END:VEVENT
+;; END:VCALENDAR