aboutsummaryrefslogtreecommitdiff
path: root/test.scm
blob: 87d0f9b29b45b8e8047b8c91ed091af240f03b76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/guile -s
!#

(add-to-load-path (dirname (current-filename)))

(use-modules (rnrs base)                ; assert
             (srfi srfi-1)
             (srfi srfi-19)
             (srfi srfi-19 util)
             (srfi srfi-41)
             (vcalendar)
             (vcalendar recur))

(define cal (make-vcomponent "testcal/repeating-event.ics"))

(define ev (car (children cal 'VEVENT)))

(define ev-copy (copy-vcomponent ev))

(assert (equal? (children ev)
                (children ev-copy)))

(define strm (recur-event ev))

(stream-for-each
 (lambda (ev)
   (format #t "~a -- ~a~%"
           (time->string (attr ev "DTSTART") "~1 ~3")
           (time->string (attr ev "DTEND") "~1 ~3")))
 (stream-take 10 (recur-event ev)))

(newline)

(for-each
 (lambda (ev)
   (format #t "~a -- ~a~%"
           (time->string (attr ev "DTSTART") "~1 ~3")
           (time->string (attr ev "DTEND") "~1 ~3")))
 (stream->list (stream-take 20 (recur-event ev))))