Ticket #156 (accepted task)
test-suite semantics change makes my code infinite loop
Reported by: | pnkfelix@… | Owned by: | schematics |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | schematics/schemeunit.plt | Keywords: | |
Cc: | Version: | (3 4) | |
Racket Version: | 4.1.4 |
Description
I was driving myself crazy trying to figure out why my Intel laptop was running my tests while my old Power Mac was taking forever to run them.
Eventually I realized it was because my Power Mac had downloaded a more recent version of Scheme Unit.
Consider the following:
#lang scheme #; (require (planet schematics/schemeunit:3) (planet schematics/schemeunit:3/text-ui)) (require (planet "main.ss" ("schematics" "schemeunit.plt" 3 (= 3))) (planet "text-ui.ss" ("schematics" "schemeunit.plt" 3 (= 3)))) (define felixs-suite (test-suite "")) (set! felixs-suite (test-suite "snoc" felixs-suite (test-case "test" (check-equal? 1 1)))) (run-tests felixs-suite)
I use the pattern above (in a more complicated manner but abstracted under a macro) to incrementally construct a set of test cases whose evaluation will be delayed until I invoke run-tests.
I can see in the Release Notes for version 3.4 that you say that you have changed things to allow "arbitrary expressions" in test suites. But I would claim that you have merely changed the set of allowable expressions, since my example worked better under the old semantics. The documentation should be improved to make this clearer.
In the meantime, can you tell me how you would achieve the effect I desire? (One way to think of the desired effect is like the Student Language's check-expect form, which delays invocation of the tests until the entire module body has been evaluated.)