aboutsummaryrefslogtreecommitdiff
path: root/tests/unit/vcomponent/create.scm
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/vcomponent/create.scm')
-rw-r--r--tests/unit/vcomponent/create.scm16
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))