;;;; (import test) (import (test-utils test)) (import (chicken string)) ;;; (test-begin "Test Utils") ;FIXME w/ expected failure test(s) (test-group "syntax for test list-of values" (define lks '(a b c)) (define lvi '(1 2 3)) (define lvf1 '(1.12345678 2.12345678 3.12345678)) (define lvf2 '(1.12345999 2.12345999 3.12345999)) (test-group "test-assert-each" (test-assert-each "1-arg" (a) (symbol? a) lks) (test-assert-each "2-arg" (a b) (and (symbol? a) (integer? b)) lks lvi) ) (test-group "test-each" (test-each "floats match" lvf2 (a) a lvf1) (test-each "syms match" lks (a) a lks) ) ) (test-group "syntax for test times" (test-assert-times "(symbol? 'a)" 5 (symbol? 'a)) (test-assert-times "(not (symbol? \"a\"))" 5 (not (symbol? "a"))) (test-times "(* 1 2)" 5 (+ 1 1) (* 1 2)) ) (test-group "test result sorting" (test-group "predicate & \"key\"" (test '((1) (2) (3)) (sort/key '((3) (1) (2)) < car)) (test #((1) (2) (3)) (sort/key #((3) (1) (2)) < car)) (test "sorts mixed" #("\t" #t (1)) (sort/key #("\t" #t (1)) stringstring)) ) (test-group "determines comparison (less-than only!)" (test '((1) (2) (3)) (sort