Re: [racket] rackunit vs test-engine

2012-08-08 Thread Joe Gilray
OK, I get it... thanks for your patience. On Wed, Aug 8, 2012 at 3:00 PM, Matthias Felleisen wrote: > > #lang racket > > (provide drop to-energy) > > (module+ test > (require rackunit) > (define ε 1e-10)) > > (define (drop t) > (* 1/2 9.8 t t)) > > (module+ test > (define-test-suite test1

Re: [racket] rackunit vs test-engine

2012-08-08 Thread Matthias Felleisen
#lang racket (provide drop to-energy) (module+ test (require rackunit) (define ε 1e-10)) (define (drop t) (* 1/2 9.8 t t)) (module+ test (define-test-suite test1 (check-= (drop 0) 0 ε) (check-= (drop 10) 490 ε))) (define (to-energy m) (* m (expt 299792458.0 2))) (module+

Re: [racket] rackunit vs test-engine

2012-08-08 Thread Joe Gilray
Sorry Matthias, but I don't understand the mechanics. I've read the guide, but I don't see how to do what I'd like without timing outside of the module. To be clear, what do I add to the following file (from the docs) in order to time the duration of all the four checks combined? #lang

Re: [racket] rackunit vs test-engine

2012-08-08 Thread Matthias Felleisen
The submodules are woven together so wrapping (test) with (time ...) should work fine. On Aug 8, 2012, at 4:18 PM, Joe Gilray wrote: > Thanks Matthias, > > Is there an easy way to "internally" time the duration of all tests? with > test-engine I could use (time (test)), with all the tests

Re: [racket] rackunit vs test-engine

2012-08-08 Thread Joe Gilray
Thanks Matthias, Is there an easy way to "internally" time the duration of all tests? with test-engine I could use (time (test)), with all the tests in a test submodule do I have to do the timing externally? I.e "TimeThis raco test myfile.rkt"? -Joe On Wed, Aug 8, 2012 at 6:31 AM, Matthias Fel

Re: [racket] rackunit vs test-engine

2012-08-08 Thread Matthias Felleisen
This first example shows how to use module+ test with test-engine: #lang racket (module+ test (require test-engine/racket-tests)) ;; Int -> Int ;; adds 2 to n (module+ test ;; setting up examples before you define the function (check-expect (add2 3) 4) (check-expect (add2 3) 5)) (de

Re: [racket] rackunit vs test-engine

2012-08-07 Thread Joe Gilray
Hi Matthias, I will take you up on your offer of an example... thanks! I've read about test-suite and test-case, but I'm not sure of the best way to test each utility in a file. Ideally the tests would be grouped with the functions: (define f1 ...) (module+ test (test-equal? "f1-tests" (f1 1

Re: [racket] rackunit vs test-engine

2012-08-07 Thread Matthias Felleisen
On Aug 7, 2012, at 8:24 PM, Joe Gilray wrote: > Now that 5.3 is out, I've been reading about submodules and their support for > testing. In the past I used test-engine/racket-tests for testing. > > Can someone please give me a rundown of when to use rackunit and > advantages/disadvantages of

[racket] rackunit vs test-engine

2012-08-07 Thread Joe Gilray
Now that 5.3 is out, I've been reading about submodules and their support for testing. In the past I used test-engine/racket-tests for testing. Can someone please give me a rundown of when to use rackunit and advantages/disadvantages of test-engine and rackunit? Thanks, -Joe