aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2019-03-22 19:51:21 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2019-03-22 19:51:21 +0100
commit265f05583d1100894c9fc79c916c923e412ec6a9 (patch)
tree692ee87aaecb9a659cf868258756c9a8963f18ee
parentCleanup and cleandown in (v r generate). (diff)
downloadcalp-265f05583d1100894c9fc79c916c923e412ec6a9.tar.gz
calp-265f05583d1100894c9fc79c916c923e412ec6a9.tar.xz
Add stuff to test.scm.
-rwxr-xr-xtest.scm66
1 files changed, 52 insertions, 14 deletions
diff --git a/test.scm b/test.scm
index 87d0f9b2..1b3c539e 100755
--- a/test.scm
+++ b/test.scm
@@ -9,6 +9,7 @@
(srfi srfi-19 util)
(srfi srfi-41)
(vcalendar)
+ (vcalendar output)
(vcalendar recur))
(define cal (make-vcomponent "testcal/repeating-event.ics"))
@@ -20,20 +21,57 @@
(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)))
+(define (display-timespan ev)
+ (format #t "~a ~a ~a -- ~a~%"
+ (attr ev 'NEW_ATTR)
+ (attr ev 'N)
+ (time->string (attr ev "DTSTART"))
+ (time->string (attr ev "DTEND"))))
+(display (attr ev 'N)) (newline)
+(display-timespan ev)
+(display (attr ev 'NEW_ATTR)) (newline)
(newline)
+(define strm (generate-recurrence-set ev))
+(display (attr ev 'RRULE)) (newline)
+
+(if #f
+ (begin
+ (stream-for-each display-timespan (stream-take 20 strm))
+
+ (newline)
+
+ ;; (define strm (generate-recurrence-set ev))
+ (display (attr ev 'RRULE)) (newline)
+
+ ;; This makes the amount of events lookad at before have the same DTSTART,
+ ;; which is the last from that set. The one's after that however are fine.
+ (stream-for-each display-timespan (stream-take 40 strm))
+ (newline)
+ ;; This makes all the DTSTART be the last dtstart
+ ;; (for-each display-timespan (stream->list (stream-take 20 strm)))
+
+;;; I believe that I might have something to do with the stream's cache.
+
+ (newline)
+
+ (display-timespan ev)
+ (display (attr ev 'NEW_ATTR))
+ (newline))
+ (begin
+ ;; These two acts as one large unit.
+ ;; Something modifies the initial ev even though it shouldn't
+ (display-timespan ev)
+ (stream-for-each
+ display-timespan
+ (stream-take 20 (generate-recurrence-set (copy-vcomponent ev))))
+ (newline)
+ (display-timespan ev)
+ (newline)
+ (stream-for-each
+ display-timespan
+ (stream-take 40 (generate-recurrence-set (copy-vcomponent ev))))
+ (newline)
+ (display-timespan ev)
+ ))
-(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))))