-
-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make *test-object* in test-engine a parameter #199
Comments
If the loaded file is under your control, organize it differently: Modular Programming |
@mfelleisen it's (by design) not. The application is: https://github.com/dbp/htdp-examplar -- I am taking student submissions, swapping their implementations with reference good/bad ones, putting their implementations into good test suites, etc. There are enough knobs on |
OK, let's see what @mikesperber says. |
I am sympathetic to solving your problem, but am not sure a parameter is a good fit for your use case. @dbp could you elaborate where the use case is coming from, and possible others? |
@mikesperber All my uses are actually in the code linked above. You can see, e.g., here: https://github.com/dbp/htdp-examplar/blob/297e0776c25dbd13af8605eb69cd2e799b589c0a/main.rkt#L60 -- I have copied the tests earlier (by initializing, loading the file, and then grabbing what is returned by Part of that is that I can only modify the current set of tests by either initializing or adding a single test, but another part is that getting tests from a file involves loading the file, which then mutates global state (and only happens the first time the file is loaded). |
@dbp Ah, I see. Thanks! Turning this into a parameter doesn't really change the imperativeness, I feel, and complicates the semantics wrt. threads. So I'd rather provide something more high level. Would a dynamic form where you do: (call-with-test-engine-disabled
(lambda ()
<your code>)) also work for you? |
This looks like something that could be a parameter:
htdp/htdp-lib/test-engine/test-engine.rkt
Line 146 in 73ec2b9
And if it were also exposed as such, it would be helpful.
As one example: I would like to be able to dynamically load a module and not have it register any of its tests (as the only reason I'm loading it is to grab a definition from its namespace). That would be easy to do if it were a parameter, but seems quite hard currently.
The text was updated successfully, but these errors were encountered: