[plt-scheme] Re: schemeunit check stuff changed?

From: Robby Findler (robby at cs.uchicago.edu)
Date: Fri Apr 13 10:22:53 EDT 2007

What I'm really after is how to define a test suite that has multiple
tests that all "count" individually. I think I figured it out:

(test/text-ui
 (test-suite
  "Examples"
  (test-case "Example 1" (check = (+ 1 1) 2))
  (test-case "Example 2" (check string=? (symbol->string 'foo) "foo"))))

In my experiments of various permutations of this I noticed that the
error reporting isn't so good. Here are some examples:

(test/text-ui
 (test-suite
  "Examples"
  (list
   (test-case "Example 1" (check = (+ 1 1) 2))
   (test-case "Example 2" (check string=? (symbol->string 'foo) "foo")))))

=> internal contract violation

(test/text-ui
 (test-suite
  (test-case "Example 1" (check = (+ 1 1) 2))
  (test-case "Example 2" (check string=? (symbol->string 'foo) "foo"))))

=> internal contract violation

Robby


On 4/13/07, Robby Findler <robby at cs.uchicago.edu> wrote:
> One more from the docs that seems fishy: can you help me again?
>
> When I run this:
>
> (require (planet "text-ui.ss" ("schematics" "schemeunit.plt" 2))
>          (planet "test.ss" ("schematics" "schemeunit.plt" 2 6)))
> (test/text-ui
>  (test-case
>   "Example"
>   (check = (+ 1 1) 2)
>   (check string=? (symbol->string 'foo) "foo")))
>
> I get this output:
>
> 1 success(es) 0 failure(s) 0 error(s) 1 test(s) run
>
> But it seems like there are two tests in there. If I make them both
> bad, then I only see the first failure.
>
> I geuss that's intentional?
>
> Robby
>


Posted on the users mailing list.