test guile scheme modules and procedures.
all accept optional title string. nested titles concatenate.
(assert-true (= 3 (+ 2 1))) (assert-true "addition" (= 3 (+ 2 1))) (assert-equal "addition" (+ 1 2) 3) (assert-and "group" (assert-true "a" (= 3 (+ 2 1))) (assert-equal "b" (+ 5 4) 6) (assert-true (+ 2 1)))
(define-test-module (test module sph string) (import (sph string)) (test-execute-procedures-lambda (string-indices ("/a////b//c/d" "/") (0 2 3 4 5 7 8 10) ("abcd" "bc") (1)) (string-multiply ("a" 3) "aaa") (string-replace-string ("abcd" "bc" "") "ad")))
string-indices 1 2 string-multiply 1 string-replace-string 1
string-quote 1 failure string-quote 2 inp "t'est" exp "\"t'est\"x" out "\"t'est\""
test module sph vector vector-append 1 test module sph record define-record 1
(define-test-module (test module mymodule) (import (mymodule)) (lambda (settings) (assert-true "addition" (= 3 (+ 2 1)))))
(define-test (name args ...) test-result) (define-test (abc) #t) (define-test (abc args expected) #t) (define-test (abc name index args expected) #t)
(import (sph) (sph test)) (define settings (test-settings-default-custom path-search "modules" reporter-name (q compact))) (test-execute-modules-by-prefix #:settings settings (q (test module sph)))
(define-as test-settings-default alist-q reporters test-reporters-default reporter-name (q default) search-type (q prefix) hook (alist-q procedure-before ignore procedure-after ignore) random-order? #f parallel? #f exception-strings? #t exclude #f only #f until #f)
execute
execute :: settings -> test-result