[plt-dev] Stepper tests for DeinProgramm language levels?

From: John Clements (clements at brinckerhoff.org)
Date: Sun Mar 22 12:41:59 EDT 2009

On Mar 22, 2009, at 7:31 AM, Michael Sperber wrote:

> Eli Barzilay <eli at barzilay.org> writes:
>> You can do that either in a new "tests/deinprogramm" collection, or  
>> in
>> some "deinprogramm/whatever" subcollection.  In any case, tell me
>> about it so I know how to update the distribution specs.
> I've checked test code into tests/deinprogramm.
>> And keep in mind my comment too -- it's fine for your tests to rely  
>> on
>> the stepper tests, but if it goes the otherway then the dependencies
>> will get messed up.
> Yes - my plan is to just run the tests myself prior to releases.

For what it's worth, I've done a rough refactoring of the stepper's  
tests to make it possible to use this framework for your tests as  
well.  Here's a simple example of a module that contains just one  
test. Now we can see how much work we've duplicated...


#lang scheme

(require tests/stepper/test-engine
          (prefix-in m: tests/stepper/language-level-model)

;; I'll be honest with you: I'm mostly in the dark w.r.t why
;; this parameterization is necessary.... I'm guessing it
;; has to do with the mutation of the current namespace
;; that occurs in run-teaching-language
(parameterize ([current-namespace (make-base-namespace)])

   (let* ([defs1 `((define (a x) (+ x 5)) (define b a))]
          [defs2 (append defs1 `((define c a)))])
     (apply         ;; you can abstract over this application with a  
      (tt 'top-ref4                   ;; - the name of the test
          m:intermediate              ;; - the language level (or  
levels) to run in
          , at defs1 (define c b) (c 3)  ;; - the expressions to test  
(everything up to the first ::)
          :: , at defs1 (define c {b})   ;; - the steps; the '::' divides  
steps, repeated '->'s indicate
          -> , at defs1 (define c {a})   ;;    that the 'before' of the  
second step is the 'after' of
          :: , at defs2 ({c} 3)          ;;    the first one.  the curly  
braces indicate the hilighted sexp.
          -> , at defs2 ({a} 3)
          :: , at defs2 {(a 3)}
          -> , at defs2 {(+ 3 5)}
          -> , at defs2 {8}))))

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2484 bytes
Desc: not available
URL: <http://lists.racket-lang.org/dev/archive/attachments/20090322/08dbf4fb/attachment.p7s>

Posted on the dev mailing list.