From 265f05583d1100894c9fc79c916c923e412ec6a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Fri, 22 Mar 2019 19:51:21 +0100 Subject: Add stuff to test.scm. --- test.scm | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++-------------- 1 file 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)))) -- cgit v1.2.3