aboutsummaryrefslogtreecommitdiff
path: root/tests/vcomponent-control.scm
blob: 8cc87a0aa925d90a693d7ec01959fb77bf21e964 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
(((vcomponent control) with-replaced-properties)
 ((vcomponent) parse-calendar)
 ((vcomponent base) prop))



(define ev (call-with-input-string
               "BEGIN:DUMMY
KEY:value
END:DUMMY"
             parse-calendar))

;; Test that temoraries are set and restored
(test-equal "value" (prop ev 'KEY))
(with-replaced-properties (ev (KEY "other"))
                          (test-equal "other" (prop ev 'KEY)))
(test-equal "value" (prop ev 'KEY))

;; Test that they are restored on non-local exit
(catch #t
  (lambda ()
   (with-replaced-properties (ev (KEY "other"))
                             (throw 'any)))
  (lambda _
    (test-equal "value" (prop ev 'KEY))))