From 39e487e74d4161ef80c23696b50a968b7a349592 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Tue, 14 Nov 2023 04:58:36 +0100 Subject: Tests for vcomponent datetime and create. --- tests/unit/vcomponent/create.scm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tests/unit/vcomponent/create.scm') 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 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)) -- cgit v1.2.3