From a84061266b97236a7b116a0f9e6fafc92c64f19c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Sat, 9 Dec 2023 00:53:28 +0100 Subject: Rename vcomponent in create module to vcomponent-create. --- module/vcomponent/create.scm | 18 +++++++++--------- tests/unit/vcomponent/create.scm | 20 ++++++++++---------- tests/unit/vcomponent/param.scm | 6 +++--- tests/unit/vcomponent/vcomponent-control.scm | 2 +- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/module/vcomponent/create.scm b/module/vcomponent/create.scm index d332a2c2..7ca39304 100644 --- a/module/vcomponent/create.scm +++ b/module/vcomponent/create.scm @@ -12,7 +12,7 @@ :use-module (hnh util type) :export (with-parameters as-list - vcomponent + create-vcomponent vcalendar vevent vtimezone standard daylight )) @@ -74,7 +74,7 @@ -(define (vcomponent type . attrs*) +(define (create-vcomponent type . attrs*) ;; Split the subforms into attributes and children (define-values (attrs children) (cond ((null? attrs*) (values '() '())) @@ -84,12 +84,12 @@ (define (value->vline key value) (cond ((vline? value) - (scm-error 'misc-error "vcomponent" + (scm-error 'misc-error "create-vcomponent" "Explicit VLines should never appear when creating components: ~s" (list value) #f)) ((list-value? value) - (scm-error 'misc-error "vcomponent" + (scm-error 'misc-error "create-vcomponent" "As-list can only be used at top level. key: ~s, value: ~s" (list key value) #f)) @@ -125,16 +125,16 @@ children)) (define (vcalendar . attrs) - (apply vcomponent 'VCALENDAR attrs)) + (apply create-vcomponent 'VCALENDAR attrs)) (define (vevent . attrs) - (apply vcomponent 'VEVENT attrs)) + (apply create-vcomponent 'VEVENT attrs)) (define (vtimezone . attrs) - (apply vcomponent 'VTIMEZONE attrs)) + (apply create-vcomponent 'VTIMEZONE attrs)) (define (standard . attrs) - (apply vcomponent 'STANDARD attrs)) + (apply create-vcomponent 'STANDARD attrs)) (define (daylight . attrs) - (apply vcomponent 'DAYLIGHT attrs)) + (apply create-vcomponent 'DAYLIGHT attrs)) diff --git a/tests/unit/vcomponent/create.scm b/tests/unit/vcomponent/create.scm index 05c56438..23df2b7f 100644 --- a/tests/unit/vcomponent/create.scm +++ b/tests/unit/vcomponent/create.scm @@ -8,7 +8,7 @@ :use-module ((vcomponent base) :select (vcomponent?)) :use-module (vcomponent) :use-module ((vcomponent create) - :select (vcomponent + :select (create-vcomponent with-parameters as-list @@ -30,20 +30,20 @@ ;; and therefore not tested (test-group "Empty component" - (let ((ev (vcomponent 'TEST))) + (let ((ev (create-vcomponent 'TEST))) (test-equal 'TEST (type ev)) (test-equal '() (children ev)) (test-equal '() (properties ev)))) (test-group "Component with properties, but no children" - (let ((ev (vcomponent 'TEST + (let ((ev (create-vcomponent 'TEST prop: "value"))) (test-equal '(PROP) (map car (properties ev))) (test-equal "value" (prop ev 'PROP)))) (test-group "Component with children, but no properties" - (let* ((child (vcomponent 'CHILD)) - (ev (vcomponent 'TEST + (let* ((child (create-vcomponent 'CHILD)) + (ev (create-vcomponent 'TEST (list child)))) (test-equal '() (properties ev)) (test-equal 1 (length (children ev))) @@ -51,8 +51,8 @@ )) (test-group "Component with both children and properties" - (let* ((child (vcomponent 'CHILD)) - (ev (vcomponent 'TEST + (let* ((child (create-vcomponent 'CHILD)) + (ev (create-vcomponent 'TEST prop: "VALUE" (list child)))) (test-equal '(PROP) (map car (properties ev))) @@ -76,19 +76,19 @@ (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)))) + (let ((ev (create-vcomponent 'TEST prop: (list 1 2 3)))) (test-equal '() (children ev)) (test-equal '(PROP) (map car (properties ev))) (test-equal '(1 2 3) (prop ev 'PROP)))) (test-group "With parameters" - (let ((ev (vcomponent 'TEST + (let ((ev (create-vcomponent 'TEST prop: (with-parameters param: 1 2)))) (test-equal 2 (prop ev 'PROP)) (test-equal '(1) (param (prop* ev 'PROP) 'PARAM)))) (test-group "As list" - (let ((ev (vcomponent 'TEST + (let ((ev (create-vcomponent 'TEST prop: (as-list (list 1 2 3))))) (test-equal '(1 2 3) (prop ev 'PROP)) (test-equal 3 (length (prop* ev 'PROP))) diff --git a/tests/unit/vcomponent/param.scm b/tests/unit/vcomponent/param.scm index 68feb1ac..94615587 100644 --- a/tests/unit/vcomponent/param.scm +++ b/tests/unit/vcomponent/param.scm @@ -9,14 +9,14 @@ :use-module (srfi srfi-88) :use-module ((vcomponent base) :select (param prop* parameters prop vline?)) - :use-module ((vcomponent) :select (vcomponent properties set-properties)) - :use-module ((vcomponent create) :select (vcomponent with-parameters)) + :use-module ((vcomponent) :select (properties set-properties)) + :use-module ((vcomponent create) :select (create-vcomponent with-parameters)) :use-module ((hnh util) :select (sort* set!)) :use-module ((ice-9 ports) :select (call-with-input-string)) ) (define v - (vcomponent 'DUMMY + (create-vcomponent 'DUMMY x-key: (with-parameters a: "1" b: "2" "Some text"))) diff --git a/tests/unit/vcomponent/vcomponent-control.scm b/tests/unit/vcomponent/vcomponent-control.scm index fbf40408..f42af4de 100644 --- a/tests/unit/vcomponent/vcomponent-control.scm +++ b/tests/unit/vcomponent/vcomponent-control.scm @@ -10,7 +10,7 @@ :select (with-replaced-properties)) :use-module ((vcomponent base) :select (prop))) -(define ev (vcomponent 'DUMMY x-key: "value")) +(define ev (create-vcomponent 'DUMMY x-key: "value")) (test-group "With replaced properties" ;; Test that temoraries are set and restored -- cgit v1.2.3