[plt-scheme] Re: schemeunit check stuff changed?
Actually, from what I can tell, examples directly from the
documentation for schemeunit don't actually work.
Here are two examples.
The first one is a test case that should pass:
(require (planet "text-ui.ss" ("schematics" "schemeunit.plt" 2 6))
(planet "test.ss" ("schematics" "schemeunit.plt" 2 6)))
(define-check (check-list= lst1 lst2)
(for-each
(lambda (elt1 elt2)
(with-check-info
(('element1 elt1)
('element2 elt2))
(if (not (equal? elt1 elt2))
(fail-check))))
lst1
lst2))
(test/text-ui
(test-suite
"hi"
(check-list= (list 1 2 3) (list 1 2 3))))
but produces this:
(file "plt/test.ss") broke the contract
(->
string?
(listof test?)
(-> any)
(-> any)
schemeunit-test-suite?)
on make-schemeunit-test-suite; expected <(listof test?)>, given: (#<void>)
The second is a test case that should fail, with interesting
information, but only says "Check failed" (much like my code was
doing):
(require (planet "text-ui.ss" ("schematics" "schemeunit.plt" 2 6))
(planet "test.ss" ("schematics" "schemeunit.plt" 2 6)))
(define-check (check-list= lst1 lst2)
(for-each
(lambda (elt1 elt2)
(with-check-info
(('element1 elt1)
('element2 elt2))
(if (not (equal? elt1 elt2))
(fail-check))))
lst1
lst2))
(test/text-ui
(test-suite
"hi"
(check-list= (list 1 2 3) (list 1 4 3))))
Robby