diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2019-03-31 00:15:26 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2019-03-31 00:15:26 +0100 |
commit | df92e179529d2caf0c12ce337ef9a6329660cabd (patch) | |
tree | e2e8c48859cf204a50cc568547c154d53ce21f7a | |
parent | Add (read only) property access from scheme. (diff) | |
download | calp-df92e179529d2caf0c12ce337ef9a6329660cabd.tar.gz calp-df92e179529d2caf0c12ce337ef9a6329660cabd.tar.xz |
Add test for properties from scheme.
Diffstat (limited to '')
-rw-r--r-- | testdata/prop.ics | 3 | ||||
-rwxr-xr-x | tests/prop.scm | 23 |
2 files changed, 26 insertions, 0 deletions
diff --git a/testdata/prop.ics b/testdata/prop.ics new file mode 100644 index 00000000..20c80180 --- /dev/null +++ b/testdata/prop.ics @@ -0,0 +1,3 @@ +BEGIN:VCOMPONENT +KEY;A=1;B=2:Some text +END:VCOMPONENT diff --git a/tests/prop.scm b/tests/prop.scm new file mode 100755 index 00000000..649e30e4 --- /dev/null +++ b/tests/prop.scm @@ -0,0 +1,23 @@ +#!/usr/bin/guile -s +!# + +(define *dir* (dirname (dirname (current-filename)))) +(define (path subdir) + (string-append *dir* "/" subdir)) + +(add-to-load-path (path "module")) + +(use-modules (srfi srfi-64) + (vcalendar)) + +(define v (make-vcomponent (path "testdata/prop.ics"))) + +(test-begin "Proporty test") +(test-equal (prop v 'KEY 'A) '(("1"))) +(test-equal (prop v 'KEY 'B) '(("2"))) +(test-equal (prop v 'KEY 'C) '()) + +(test-equal (properties v 'KEY) '(A B)) +(test-equal (properties v "KEY") '(A B)) + +(test-end "Proporty test") |