aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/vcomponent-control.scm25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/vcomponent-control.scm b/tests/vcomponent-control.scm
new file mode 100644
index 00000000..318c4335
--- /dev/null
+++ b/tests/vcomponent-control.scm
@@ -0,0 +1,25 @@
+(((vcomponent control) with-replaced-attrs)
+ ((vcomponent) parse-calendar)
+ ((vcomponent base) attr))
+
+
+
+(define ev (call-with-input-string
+ "BEGIN:DUMMY
+KEY:value
+END:DUMMY"
+ parse-calendar))
+
+;; Test that temoraries are set and restored
+(test-equal "value" (attr ev 'KEY))
+(with-replaced-attrs (ev (KEY "other"))
+ (test-equal "other" (attr ev 'KEY)))
+(test-equal "value" (attr ev 'KEY))
+
+;; Test that they are restored on non-local exit
+(catch #t
+ (lambda ()
+ (with-replaced-attrs (ev (KEY "other"))
+ (throw 'any)))
+ (lambda _
+ (test-equal "value" (attr ev 'KEY))))