From f7716ac1a87649cad96242f2d5bf0a987d7f430c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Mon, 7 Mar 2022 15:31:00 +0100 Subject: Add new tests. --- tests/param.scm | 39 --------------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 tests/param.scm (limited to 'tests/param.scm') diff --git a/tests/param.scm b/tests/param.scm deleted file mode 100644 index cf8c9458..00000000 --- a/tests/param.scm +++ /dev/null @@ -1,39 +0,0 @@ -;;; Commentary: -;; Checks that parameters (1) are correctly parsed and stored. -;; (1): 'A', and 'B' in the line "KEY;A=1;B=2:Some text" -;;; Code: - -(((vcomponent base) param prop* parameters prop) - ((vcomponent formats ical parse) parse-calendar) - ((vcomponent) make-vcomponent) - ((hnh util) sort* set!)) - -(define v (call-with-input-string - "BEGIN:DUMMY -X-KEY;A=1;B=2:Some text -END:DUMMY" - parse-calendar)) - -(test-equal '("1") (param (prop* v 'X-KEY) 'A)) -(test-equal '("2") (param (prop* v 'X-KEY) 'B)) -(test-equal #f (param (prop* v 'X-KEY) 'C)) - -(test-equal '(A B) (sort* (map car (parameters (prop* v 'X-KEY))) - stringstring)) - -;; TODO possibly move this. -;; Checks that a warning is properly raised for -;; unkonwn keys (without an X-prefix) -(test-error - 'warning - (call-with-input-string "BEGIN:DUMMY -KEY:Some Text -END:DUMMY")) - -;; Similar thing happens for sxcal, but during serialization instead -(let ((component (make-vcomponent 'DUMMY))) - (set! (prop component 'KEY) "Anything") - (test-error - 'warning - (vcomponent->sxcal component))) -- cgit v1.2.3