racket / htdp

Other
93 stars 70 forks source link

Issue 203 take 2 #207

Closed rfindler closed 1 year ago

rfindler commented 1 year ago

This tries a different approach to issue #203 that doesn't introduce the bug identified in #205.

It may be, however, that simply not inserting (test) is the right move if the dynamic-require in the body of make-dynamic-requirer already is going to run the tests without any intervention at this level, which would mean yet a slightly different fix is the right one.

Meanwhile, this at least passes the two test cases.

rfindler commented 1 year ago

@mikesperber pointed out, offline, that the #%module-begin that the teaching languages insert puts in a call to test. It looks like that call is here and that, according to DrRacket is this definition. DrRacket also thinks that the call to test that's in the diff in this PR, generated by the function make-dynamic-requirer in "run-teaching-program.rkt" is the same one (although the nominal require is different).

The call in the #%module-begin, however, is inside a test submodule, so it seems like the right thing to do here is mimic what the #lang-based languages do, and dynamic-requir the test submodule.

I've updated the PR to do that.

rfindler commented 1 year ago

The language-test (the one that discovered the problem) is passing with this change (and it also has a test case for #203 in it now, too, which also passes).