On 3/19/20, Alexandre Rademaker <aradema...@gmail.com> wrote:
>
> Suppose I have some functions defined in a file A.rkt and some tests defined
> in the file B.rkt. How can I execute the tests in the command line?
>
> I was expecting to be able to run
>
>> racket A.rkt B.rkt
>
> But this does not evaluate the expressions on B.rkt as I was expecting!
>
> 1. Do I need to export the functions in A.rkt with (provide …)?
> 2. Do I need to add the (require …) in B.rkt?
>
>
> The idea is to have the students submitting their A.rkt files and I could
> test all of them using a single set of tests in another racket file.
>
> Ideas? What am I missing?

If A.rkt contains a few expressions (and no #lang):

```
  (define a 2)
```

and B.rkt contains a few expressions:

```
(unless (= 6 a)
  (error 'bad))
```

then `racket -I racket --load a.rkt --load b.rkt` evaluates the
expressions in A and then the expressions in B, as if they were all
part of the same #lang racket file

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAFUu9R735FzZxd9p6mXNP-DFU-D5%3DhC-fpzaBuDAVGvGTTVHsA%40mail.gmail.com.

Reply via email to