aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2021-08-24 19:38:42 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2021-08-24 19:39:12 +0200
commit2f79da027729c6f84427cb2cbfb5a63d52006004 (patch)
tree18365f1a0ca8e9466a456ecc794a9bc19c9ded15 /tests
parentFix warning calls in string->datetime. (diff)
downloadcalp-2f79da027729c6f84427cb2cbfb5a63d52006004.tar.gz
calp-2f79da027729c6f84427cb2cbfb5a63d52006004.tar.xz
Warnings are errors when running tests.
Should prevent warnings from slipping through the cracks.
Diffstat (limited to 'tests')
-rw-r--r--tests/param.scm10
-rwxr-xr-xtests/run-tests.scm3
-rw-r--r--tests/vcomponent-control.scm14
-rw-r--r--tests/vcomponent.scm6
4 files changed, 18 insertions, 15 deletions
diff --git a/tests/param.scm b/tests/param.scm
index 23704948..39eac5d0 100644
--- a/tests/param.scm
+++ b/tests/param.scm
@@ -9,14 +9,14 @@
(define v (call-with-input-string
"BEGIN:DUMMY
-KEY;A=1;B=2:Some text
+X-KEY;A=1;B=2:Some text
END:DUMMY"
parse-calendar))
-(test-equal '("1") (param (prop* v 'KEY) 'A))
-(test-equal '("2") (param (prop* v 'KEY) 'B))
-(test-equal #f (param (prop* v 'KEY) 'C))
+(test-equal '("1") (param (prop* v 'X-KEY) 'A))
+(test-equal '("2") (param (prop* v 'X-KEY) 'B))
+(test-equal #f (param (prop* v 'X-KEY) 'C))
-(test-equal '(A B) (sort* (map car (parameters (prop* v 'KEY)))
+(test-equal '(A B) (sort* (map car (parameters (prop* v 'X-KEY)))
string<?
symbol->string))
diff --git a/tests/run-tests.scm b/tests/run-tests.scm
index fd91c264..5aba4f4f 100755
--- a/tests/run-tests.scm
+++ b/tests/run-tests.scm
@@ -68,6 +68,9 @@
;; but is initially bound to #f.
(test-begin "tests")
+;; Forces all warnings to be explicitly handled by tests
+((@ (calp util exceptions) warnings-are-errors) #t)
+
(for fname in files
(format (current-error-port) "Running test ~a~%" fname)
(test-group
diff --git a/tests/vcomponent-control.scm b/tests/vcomponent-control.scm
index 2ee4c243..a1300a8c 100644
--- a/tests/vcomponent-control.scm
+++ b/tests/vcomponent-control.scm
@@ -10,20 +10,20 @@
(define ev (call-with-input-string
"BEGIN:DUMMY
-KEY:value
+X-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-equal "value" (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 that they are restored on non-local exit
(catch #t
(lambda ()
- (with-replaced-properties (ev (KEY "other"))
+ (with-replaced-properties (ev (X-KEY "other"))
(throw 'any)))
(lambda _
- (test-equal "value" (prop ev 'KEY))))
+ (test-equal "value" (prop ev 'X-KEY))))
diff --git a/tests/vcomponent.scm b/tests/vcomponent.scm
index 15c83845..28f1cf91 100644
--- a/tests/vcomponent.scm
+++ b/tests/vcomponent.scm
@@ -7,10 +7,10 @@
(define ev (call-with-input-string
"BEGIN:DUMMY
-KEY:value
+X-KEY:value
END:DUMMY"
parse-calendar))
(test-assert (eq? #f (prop ev 'MISSING)))
-(test-assert (prop ev 'KEY))
-(test-equal "value" (prop ev 'KEY))
+(test-assert (prop ev 'X-KEY))
+(test-equal "value" (prop ev 'X-KEY))