From fb77fc13d86c620326eb1e8c15162182e9b7d105 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Sat, 20 Apr 2019 21:59:03 +0200 Subject: Fix up tests. --- tests/let.scm | 4 ---- tests/prop.scm | 12 ++++-------- tests/recurring.scm | 3 --- tests/rrule-parse.scm | 4 ---- tests/run-tests.scm | 10 +++------- tests/termios.scm | 4 ---- 6 files changed, 7 insertions(+), 30 deletions(-) diff --git a/tests/let.scm b/tests/let.scm index 53f39e4c..02e38a42 100644 --- a/tests/let.scm +++ b/tests/let.scm @@ -1,7 +1,5 @@ (use-modules (util)) -(test-begin "let") - (test-assert (let* ((a #t)) a)) (test-assert (let* (((a . b) '(#t . #f))) a)) (test-assert (let* (((a . b) (cons* #f #t))) b)) @@ -14,5 +12,3 @@ (test-equal 30 (let* (x y) (set! x 10) (set! y 20) (+ x y))) (test-assert (let* (x) (not x))) (test-equal 6 (let* ((x 1) y z) (set! y 2) (set! z 3) (+ x y z))) - -(test-end "let") diff --git a/tests/prop.scm b/tests/prop.scm index d63703cd..249dd21b 100644 --- a/tests/prop.scm +++ b/tests/prop.scm @@ -4,12 +4,8 @@ (string-append (getenv "TESTPATH") "/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 '("1") (prop (attr* v 'KEY) 'A)) +(test-equal '("2") (prop (attr* v 'KEY) 'B)) +(test-equal #f (prop (attr* v 'KEY) 'C)) -(test-equal (properties v 'KEY) '(A B)) -(test-equal (properties v "KEY") '(A B)) - -(test-end "Proporty test") +(test-equal '(A B) (map car (properties (attr* v 'KEY)))) diff --git a/tests/recurring.scm b/tests/recurring.scm index ebf40cb1..7e4f60ba 100644 --- a/tests/recurring.scm +++ b/tests/recurring.scm @@ -18,8 +18,6 @@ (getenv "TESTPATH") str)) -(test-begin "recurrence test") - (define cal-1 (make-vcomponent (tcal "simple-daily.ics"))) (let ((ev (car (children cal-1 'VEVENT)))) @@ -47,4 +45,3 @@ (s4 (add-day s3))) (list s0 s1 s2 s3 s4))) ) -(test-end "recurrence test") diff --git a/tests/rrule-parse.scm b/tests/rrule-parse.scm index b3bbe770..f620e882 100644 --- a/tests/rrule-parse.scm +++ b/tests/rrule-parse.scm @@ -1,5 +1,3 @@ -(test-begin "RRULE parse") - (use-modules (vcalendar recurrence parse)) (define-syntax mkrule @@ -31,5 +29,3 @@ (parse-recurrence-rule "FREQ=HOURLY;COUNT=-1") ; TODO this error seems to have an error ;; => #< freq: HOURLY until: #f count: #< freq: HOURLY until: #f count: #f interval: 1 bysecond: #f byminute: #f byhour: #f byday: #f bymonthday: #f byyearday: #f byweekno: #f bymonth: #f bysetpos: #f wkst: MO> interval: 1 bysecond: #f byminute: #f byhour: #f byday: #f bymonthday: #f byyearday: #f byweekno: #f bymonth: #f bysetpos: #f wkst: MO> ;; ERR unfulfilled-constraint [-1] doesn't fulfill constraint of type [COUNT], ignoring - -(test-end "RRULE parse") diff --git a/tests/run-tests.scm b/tests/run-tests.scm index e68f058b..529878c7 100755 --- a/tests/run-tests.scm +++ b/tests/run-tests.scm @@ -27,11 +27,7 @@ ;; Load tests (add-to-load-path here) -(for-each load-from-path files) -;; Final test, triggers output -(test-begin "metatest") -(test-assert #t) -(test-expect-fail 1) -(test-assert #f) -(test-end "metatest") +(test-begin "tests") +(for-each load-from-path files) +(test-end "tests") diff --git a/tests/termios.scm b/tests/termios.scm index 707648d4..3d5ef9d1 100755 --- a/tests/termios.scm +++ b/tests/termios.scm @@ -20,8 +20,6 @@ (define-syntax-rule (&= lvalue val) (mod! lvalue (lambda (v) (& v val)))) -(test-begin "termios") - (define t (make-termios)) (test-equal 0 (tcgetattr! t)) @@ -35,5 +33,3 @@ (test-equal (& ifl (~ (|| ECHO ICANON))) (lflag t)) (test-equal 0 (tcsetattr! copy)) - -(test-end "termios") -- cgit v1.2.3