diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-11-14 04:58:36 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-11-16 00:51:19 +0100 |
commit | 39e487e74d4161ef80c23696b50a968b7a349592 (patch) | |
tree | 2aa3e92d48340e288dd39628a51c7d09bc609f89 /tests/unit/vcomponent/create.scm | |
parent | Formatting changes. (diff) | |
download | calp-39e487e74d4161ef80c23696b50a968b7a349592.tar.gz calp-39e487e74d4161ef80c23696b50a968b7a349592.tar.xz |
Tests for vcomponent datetime and create.
Diffstat (limited to 'tests/unit/vcomponent/create.scm')
-rw-r--r-- | tests/unit/vcomponent/create.scm | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/unit/vcomponent/create.scm b/tests/unit/vcomponent/create.scm index 537ccbe9..8137d723 100644 --- a/tests/unit/vcomponent/create.scm +++ b/tests/unit/vcomponent/create.scm @@ -2,6 +2,7 @@ :use-module ((srfi srfi-1) :select (every)) :use-module (srfi srfi-64) :use-module (srfi srfi-88) + :use-module ((hnh util) :select (-> sort*)) :use-module ((vcomponent base) :select (vcomponent?)) :use-module ((vcomponent create) :select (vcomponent @@ -18,6 +19,7 @@ properties type prop prop* + extract param vline?))) @@ -56,6 +58,20 @@ ; (test-eq child (car (children ev))) )) +(test-group "Component with multiple children" + (let ((cal + (vcalendar + calscale: "GREGORIAN" + (list + (vevent summary: "Child 1") + (vevent summary: "Child 2"))))) + (test-equal 2 (length (children cal))) + (test-equal "GREGORIAN" (-> cal (prop 'CALSCALE))) + (let ((ch (sort* (children cal) + string<? (extract 'SUMMARY)))) + (test-equal "Child 1" (-> ch (list-ref 0) (prop 'SUMMARY))) + (test-equal "Child 2" (-> ch (list-ref 1) (prop 'SUMMARY)))))) + (test-group "Component with no children, where last elements value is a list" (let ((ev (vcomponent 'TEST prop: (list 1 2 3)))) (test-equal '() (children ev)) |