aboutsummaryrefslogtreecommitdiff
path: root/tests/formats/ical.scm
diff options
context:
space:
mode:
Diffstat (limited to 'tests/formats/ical.scm')
-rw-r--r--tests/formats/ical.scm24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/formats/ical.scm b/tests/formats/ical.scm
new file mode 100644
index 00000000..5747e2ea
--- /dev/null
+++ b/tests/formats/ical.scm
@@ -0,0 +1,24 @@
+(define-module (ical)
+ :use-module (srfi srfi-88)
+ :use-module ((hnh util) :select (sort*))
+ :use-module (hnh util path)
+ :use-module ((rnrs io ports) :select (get-string-all))
+ :use-module ((vcomponent formats ical) :prefix #{ics:}#)
+ :export (sanitize-string
+ serialize
+ deserialize
+ component-str))
+
+;; Technically not back into source, since order of children isn't
+;; stable. That's also why we just check that all lines are present,
+;; regardless of order.
+(define (sanitize-string str)
+ (sort* (string-split str #\newline)
+ string<))
+
+(define serialize ics:serialize)
+(define deserialize ics:deserialize)
+
+(define component-str
+ (call-with-input-file (path-append (getenv "here") "event.ics")
+ get-string-all))