Skip to content

Commit

Permalink
a second attempt to fix #203
Browse files Browse the repository at this point in the history
Judging from the current code, at some point in the distant past, test cases
were run by rewrite the module body to insert a call that kicked off the test
cases. Get slightly closer to that world by moving the test case into the
main body of the dynamic-wind so that errors in either the testing or the module
body don't skip the call that initializes the REPL
  • Loading branch information
rfindler committed Oct 8, 2023
1 parent 4d5cf96 commit 5340171
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions htdp-lib/lang/run-teaching-program.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@
(dynamic-wind
void
(lambda ()
(dynamic-require ''#,module-name #f)) ;; work around a bug in dynamic-require
(dynamic-require ''#,module-name #f) ;; work around a bug in dynamic-require
#,(if enable-testing?
#'(test)
#'(begin)))
(lambda ()
(unless done-already?
(set! done-already? #t)
#,(if enable-testing?
#'(test)
#'(begin))
(current-namespace (module->namespace ''#,module-name))))))))

;; take all of the body expressions from the port
Expand Down

0 comments on commit 5340171

Please sign in to comment.