From 2f79da027729c6f84427cb2cbfb5a63d52006004 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Tue, 24 Aug 2021 19:38:42 +0200 Subject: Warnings are errors when running tests. Should prevent warnings from slipping through the cracks. --- tests/param.scm | 10 +++++----- tests/run-tests.scm | 3 +++ tests/vcomponent-control.scm | 14 +++++++------- tests/vcomponent.scm | 6 +++--- 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))) stringstring)) 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)) -- cgit v1.2.3