From fe4b521e1197a57a45dfbfde1d2d09bd3fafa3b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Tue, 24 Aug 2021 19:39:55 +0200 Subject: Add tests for iCal unknown key warnings. --- tests/param.scm | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'tests/param.scm') diff --git a/tests/param.scm b/tests/param.scm index 39eac5d0..a60e8d47 100644 --- a/tests/param.scm +++ b/tests/param.scm @@ -3,9 +3,10 @@ ;; (1): 'A', and 'B' in the line "KEY;A=1;B=2:Some text" ;;; Code: -(((vcomponent base) param prop* parameters) +(((vcomponent base) param prop* parameters prop) ((vcomponent parse) parse-calendar) - ((calp util) sort*)) + ((vcomponent) make-vcomponent) + ((calp util) sort* set!)) (define v (call-with-input-string "BEGIN:DUMMY @@ -20,3 +21,19 @@ END:DUMMY" (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