diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-02-23 03:00:20 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-02-23 04:04:04 +0100 |
commit | 2de493b798997027758fb3540c796a3f06f9ade1 (patch) | |
tree | 98a2fe150732a34554454c0cf873ece1481f0abb /tests/test/vcomponent-control.scm | |
parent | Change group-by to return direct pairs. (diff) | |
download | calp-2de493b798997027758fb3540c796a3f06f9ade1.tar.gz calp-2de493b798997027758fb3540c796a3f06f9ade1.tar.xz |
Start using (vcomponent create) in tests.
This allows us to focus on what we are testing, instead of on the parser
in question. It also makes the code parser-agnostic.
Diffstat (limited to '')
-rw-r--r-- | tests/test/vcomponent-control.scm | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/tests/test/vcomponent-control.scm b/tests/test/vcomponent-control.scm index f408c8b4..6ab38996 100644 --- a/tests/test/vcomponent-control.scm +++ b/tests/test/vcomponent-control.scm @@ -5,32 +5,32 @@ (define-module (test vcomponent-control) :use-module (srfi srfi-64) :use-module (srfi srfi-88) + :use-module ((vcomponent create)) :use-module ((vcomponent util control) :select (with-replaced-properties)) :use-module ((vcomponent formats ical parse) :select (parse-calendar)) :use-module ((vcomponent base) :select (prop))) -(define ev - (call-with-input-string - "BEGIN:DUMMY\nX-KEY:value\nEND:DUMMY" - parse-calendar)) +(define ev (vcomponent 'DUMMY x-key: "value")) -;; Test that temoraries are set and restored -(test-equal "value" (prop ev 'X-KEY)) +(test-group "With replaced properties" + ;; Test that temoraries are set and restored + (test-equal "value" (prop ev 'X-KEY)) -(with-replaced-properties - (ev (X-KEY "other")) - (test-equal "other" (prop ev 'X-KEY))) + (with-replaced-properties + (ev (X-KEY "other")) + (test-equal "other" (prop ev 'X-KEY))) -(test-equal "value" (prop ev 'X-KEY)) + (test-equal "value" (prop ev 'X-KEY))) ;; Test that they are restored on non-local exit -(catch #t - (lambda () - (with-replaced-properties - (ev (X-KEY "other")) - (throw 'any))) - (lambda _ (test-equal "value" (prop ev 'X-KEY)))) +(test-group "With replaced properties when throwing" + (catch #t + (lambda () + (with-replaced-properties + (ev (X-KEY "other")) + (throw 'any))) + (lambda _ (test-equal "value" (prop ev 'X-KEY))))) |