From 715e36ab81389ebf53ea158027d0a83f144eee0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Tue, 30 Jun 2020 01:58:19 +0200 Subject: Finished renamining attribute to property. --- tests/prop.scm | 10 +++++----- tests/recurrence.scm | 20 ++++++++++---------- tests/recurring.scm | 6 +++--- tests/vcomponent-control.scm | 18 +++++++++--------- tests/vcomponent.scm | 8 ++++---- tests/xcal.scm | 4 ++-- 6 files changed, 33 insertions(+), 33 deletions(-) (limited to 'tests') diff --git a/tests/prop.scm b/tests/prop.scm index 60831e14..cec0a8e2 100644 --- a/tests/prop.scm +++ b/tests/prop.scm @@ -1,6 +1,6 @@ ;;; TODO rename this file to param.scm -(((vcomponent base) param attr* parameters) +(((vcomponent base) param prop* parameters) ((vcomponent parse) parse-calendar) ((util) sort*)) @@ -10,10 +10,10 @@ KEY;A=1;B=2:Some text END:DUMMY" parse-calendar)) -(test-equal '("1") (param (attr* v 'KEY) 'A)) -(test-equal '("2") (param (attr* v 'KEY) 'B)) -(test-equal #f (param (attr* v 'KEY) 'C)) +(test-equal '("1") (param (prop* v 'KEY) 'A)) +(test-equal '("2") (param (prop* v 'KEY) 'B)) +(test-equal #f (param (prop* v 'KEY) 'C)) -(test-equal '(A B) (sort* (map car (parameters (attr* v 'KEY))) +(test-equal '(A B) (sort* (map car (parameters (prop* v 'KEY))) stringstring)) diff --git a/tests/recurrence.scm b/tests/recurrence.scm index 3abe7b1e..fad8e7dc 100644 --- a/tests/recurrence.scm +++ b/tests/recurrence.scm @@ -9,7 +9,7 @@ ((vcomponent recurrence generate) generate-recurrence-set) ((vcomponent recurrence display) format-recurrence-rule) ((vcomponent recurrence internal) count until) - ((vcomponent base) make-vcomponent attr attr* extract) + ((vcomponent base) make-vcomponent prop prop* extract) ((datetime) parse-ics-datetime datetime time date) ((util) -> mod!) ((guile) set!) @@ -20,18 +20,18 @@ (define (run-test comp) - (test-equal (string-append "RSET: " (attr comp 'SUMMARY)) - (attr comp 'X-SET) + (test-equal (string-append "RSET: " (prop comp 'SUMMARY)) + (prop comp 'X-SET) (let ((r (generate-recurrence-set comp))) (map (extract 'DTSTART) - (if (or (until (attr comp 'RRULE)) - (count (attr comp 'RRULE))) + (if (or (until (prop comp 'RRULE)) + (count (prop comp 'RRULE))) (stream->list r) (stream->list 20 r))))) - (test-equal (string-append "STR: " (attr comp 'SUMMARY)) - (attr comp 'X-SUMMARY) - (format-recurrence-rule (attr comp 'RRULE)))) + (test-equal (string-append "STR: " (prop comp 'SUMMARY)) + (prop comp 'X-SUMMARY) + (format-recurrence-rule (prop comp 'RRULE)))) (define (vevent . rest) @@ -43,14 +43,14 @@ keyword->string string-upcase string->symbol))) - (set! (attr v symb) + (set! (prop v symb) (case symb [(DTSTART EXDATE) (parse-ics-datetime (cadr rem))] [(RRULE) (parse-recurrence-rule (cadr rem))] [else (cadr rem)])) ;; hack for multi valued fields (when (eq? symb 'EXDATE) - (mod! (attr* v symb) list))) + (mod! (prop* v symb) list))) (loop (cddr rem)))) v) diff --git a/tests/recurring.scm b/tests/recurring.scm index c5ae43c6..3922f1b6 100644 --- a/tests/recurring.scm +++ b/tests/recurring.scm @@ -1,6 +1,6 @@ (((srfi srfi-41) stream-take stream-map stream->list stream-car) ((datetime util) day-stream) - ((vcomponent base) extract attr) + ((vcomponent base) extract prop) ((vcomponent) parse-calendar) ((vcomponent recurrence) generate-recurrence-set)) @@ -27,7 +27,7 @@ END:VEVENT" (generate-recurrence-set ev))) (stream->list 5 (day-stream - (attr ev 'DTSTART)))) + (prop ev 'DTSTART)))) ;; We run the exact same thing a secound time, since I had an error with ;; that during development. @@ -40,7 +40,7 @@ END:VEVENT" (stream->list (stream-take 5 (day-stream - (attr ev 'DTSTART))))) + (prop ev 'DTSTART))))) (define ev diff --git a/tests/vcomponent-control.scm b/tests/vcomponent-control.scm index 318c4335..8cc87a0a 100644 --- a/tests/vcomponent-control.scm +++ b/tests/vcomponent-control.scm @@ -1,6 +1,6 @@ -(((vcomponent control) with-replaced-attrs) +(((vcomponent control) with-replaced-properties) ((vcomponent) parse-calendar) - ((vcomponent base) attr)) + ((vcomponent base) prop)) @@ -11,15 +11,15 @@ END:DUMMY" parse-calendar)) ;; Test that temoraries are set and restored -(test-equal "value" (attr ev 'KEY)) -(with-replaced-attrs (ev (KEY "other")) - (test-equal "other" (attr ev 'KEY))) -(test-equal "value" (attr ev 'KEY)) +(test-equal "value" (prop ev 'KEY)) +(with-replaced-properties (ev (KEY "other")) + (test-equal "other" (prop ev 'KEY))) +(test-equal "value" (prop ev 'KEY)) ;; Test that they are restored on non-local exit (catch #t (lambda () - (with-replaced-attrs (ev (KEY "other")) - (throw 'any))) + (with-replaced-properties (ev (KEY "other")) + (throw 'any))) (lambda _ - (test-equal "value" (attr ev 'KEY)))) + (test-equal "value" (prop ev 'KEY)))) diff --git a/tests/vcomponent.scm b/tests/vcomponent.scm index 7a392e9e..0d81ab0e 100644 --- a/tests/vcomponent.scm +++ b/tests/vcomponent.scm @@ -1,4 +1,4 @@ -(((vcomponent base) attr) +(((vcomponent base) prop) ((vcomponent) parse-calendar)) (define ev (call-with-input-string @@ -7,6 +7,6 @@ KEY:value END:DUMMY" parse-calendar)) -(test-assert (eq? #f (attr ev 'MISSING))) -(test-assert (attr ev 'KEY)) -(test-equal "value" (attr ev 'KEY)) +(test-assert (eq? #f (prop ev 'MISSING))) +(test-assert (prop ev 'KEY)) +(test-equal "value" (prop ev 'KEY)) diff --git a/tests/xcal.scm b/tests/xcal.scm index 78e7e7df..88c708f4 100644 --- a/tests/xcal.scm +++ b/tests/xcal.scm @@ -3,7 +3,7 @@ ((output xcal) vcomponent->sxcal) ((util) ->) ((vcomponent base) - parameters attr* children) + parameters prop* children) ) ;;; Some different types, same parameters @@ -41,5 +41,5 @@ END:VCALENDAR" (test-equal "xcal parameters" '((X-TEST-PARAM "10")) - (parameters (attr* (car (children twice-converted)) + (parameters (prop* (car (children twice-converted)) 'STATUS))) -- cgit v1.2.3