diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-02-23 03:00:20 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-02-23 04:04:04 +0100 |
commit | 2de493b798997027758fb3540c796a3f06f9ade1 (patch) | |
tree | 98a2fe150732a34554454c0cf873ece1481f0abb /tests/test/xcal.scm | |
parent | Change group-by to return direct pairs. (diff) | |
download | calp-2de493b798997027758fb3540c796a3f06f9ade1.tar.gz calp-2de493b798997027758fb3540c796a3f06f9ade1.tar.xz |
Start using (vcomponent create) in tests.
This allows us to focus on what we are testing, instead of on the parser
in question. It also makes the code parser-agnostic.
Diffstat (limited to '')
-rw-r--r-- | tests/test/xcal.scm | 43 |
1 files changed, 22 insertions, 21 deletions
diff --git a/tests/test/xcal.scm b/tests/test/xcal.scm index 48d43c59..87468370 100644 --- a/tests/test/xcal.scm +++ b/tests/test/xcal.scm @@ -6,12 +6,13 @@ (define-module (test xcal) :use-module (srfi srfi-64) :use-module (srfi srfi-88) + :use-module (datetime) + :use-module ((vcomponent create) + :select (vcalendar vevent with-parameters)) :use-module ((vcomponent formats xcal parse) :select (sxcal->vcomponent)) :use-module ((vcomponent formats xcal output) :select (vcomponent->sxcal)) - :use-module ((vcomponent formats ical parse) - :select (parse-calendar)) :use-module ((hnh util) :select (->)) :use-module ((vcomponent base) :select (parameters prop* children))) @@ -19,25 +20,25 @@ ;;; Some different types, same parameters (define ev - (call-with-input-string - "BEGIN:VCALENDAR -VERSION:2.0 -PRODID:-//calparse-test -BEGIN:VEVENT -SUMMARY:Test event -DTSTART;TZID=Europe/Stockholm:20200625T133000 -DTEND:20200625T143000Z -DTSTAMP:20200609T131418Z -UID:1 -SEQUENCE:0 -CREATED:20200609T081725Z -DESCRIPTION:Short description -LAST-MODIFIED:20200609T081725Z -STATUS;X-TEST-PARAM=10:CONFIRMED -TRANSP:OPAQUE -END:VEVENT -END:VCALENDAR" - parse-calendar)) + (vcalendar + version: "2.0" + prodid: "-//calparse-test" + (list (vevent + summary: "Test event" + dtstart: (with-parameters + tzid: "Europe/Stockholm" + #2020-06-25T13:30:00) + dtend: #2020-06-25T14:30:00Z + dtstamp: #2020-06-09T13:14:18Z + uid: "1" + sequence: 0 + created: #2020-06-09T08:17:25Z + description: "Short description" + last-modified: #2020-06-09T08:17:25Z + status: (with-parameters + x-test-param: 10 + 'CONFIRMED) + transp: 'OPAQUE)))) (define twice-converted (-> ev vcomponent->sxcal sxcal->vcomponent)) |