Re: Unit tests for a #lang implementation

Konrad Hinsen <[email protected]>
Newsgroups gmane.comp.lang.racket.user,gmane.lisp.scheme.plt
Message-ID <[email protected]>
On 25/08/2017 17:03, Konrad Hinsen wrote:

> That adds the missing piece - thanks a lot! I had seriously 
> underestimated the complexity of module definitions in Racket.

A followup mostly for the benefit of those who find this thread in the 
archives one day.

Importing a module this way works perfectly, but its utility for testing 
is very limited. The problem I run into is illustrated by the following 
symptom:

raco test: (submod "lang-test.rkt" test)
document-contexts: contract violation;
  given value instantiates a different structure type with the same name
   expected: document?
   given: (document (hash "test-context"  ...


My code defines a structure called "document", which apparently exists 
in two copies in memory. One is used by the module lang-test.rkt that 
contains the tests, and the other one is used by the module that was 
created from the text string. As a consequence, it is impossible to 
perform any operation on the date from that module.

If all you recover from that module is basic Racket data structures, 
everything works fine.

Konrad.

-- 
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+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
For more options, visit https://groups.google.com/d/optout.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.