From 8795fd45974d1969db9ec155730155a7e89e5469 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Fri, 1 Dec 2023 21:27:41 +0100 Subject: Improve output format for vcomponents. A stantdalone vline is now it's own constructor, and includes its parameters. Complete vcomponents instead serialize vlines to the vcomponent create syntax, which sometimes hides the existance of a vline completely. --- tests/unit/vcomponent/vcomponent.scm | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) (limited to 'tests/unit/vcomponent/vcomponent.scm') diff --git a/tests/unit/vcomponent/vcomponent.scm b/tests/unit/vcomponent/vcomponent.scm index 2f692d19..87fddb5f 100644 --- a/tests/unit/vcomponent/vcomponent.scm +++ b/tests/unit/vcomponent/vcomponent.scm @@ -89,16 +89,26 @@ (K2 . "V2")))))) (test-equal "VLine string representation" - "#< key: KEY value: \"Value\" parameters: #f>" + "(vline #:key KEY #:vline-value \"Value\") +" + (with-output-to-string + (lambda () + (write (vline key: 'KEY vline-value: "Value") )))) + +(test-equal "VLine with parameters representation" + "(vline #:key + KEY + #:vline-value + \"Value\" + #:vline-parameters + (#:a \"1\")) +" (with-output-to-string (lambda () - (write (vline key: 'KEY vline-value: "Value") )))) - -;; (test-equal "VLine with parameters representation" -;; "#< key: KEY value: \"Value\" parameters: #f>" -;; (with-output-to-string -;; (lambda () -;; (write (vline key: 'KEY vline-value: "Value") )))) + (write (vline key: 'KEY + vline-value: "Value" + vline-parameters: + (alist->table '((a . "1")))))))) (test-equal "VComponent string representation" "(vcomponent @@ -106,9 +116,12 @@ (list (vcomponent 'VEVENT #:dtstart - #< key: DTSTART value: #2023-03-01T10:00:00 parameters: #f> + (with-parameters + #:TZID + \"Europe/Stockholm\" + #2023-03-01T10:00:00) #:uid - #< key: UID value: \"049d9004-cb1e-4c8d-bb54-042689d9808b\" parameters: #f>))) + \"049d9004-cb1e-4c8d-bb54-042689d9808b\"))) " (with-output-to-string -- cgit v1.2.3