-
Notifications
You must be signed in to change notification settings - Fork 123
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
Fix bug in dumpableType
function. Fixes #946.
#947
Conversation
The function now works as documented, and succeeds on function types that do not have `Bit` as a return type.
We should also add a regression test before merging this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks right, pending a regression test.
This only checks that a function with signature [32] -> [32] -> [32] will succeed with the :dumptests command. More tests could/should be added. Since this test creates a file called add32.out, I added tests/regression/*.out to the .gitignore. I'm not sure if this is the right approach or if we should make an attempt to clean up this subdirectory after the tests finish.
Added a regression test. A couple potential issues that I could resolve with a subsequent commit, if deemed necessary:
|
Thanks @benjaminselfridge for adding the regression test! I was also unsure about how to handle a regression test that generates a file. I just added @yav as a reviewer; we can see what he thinks about it. |
I don't have a strong opinion but it would be nice to not have left over files. After all, if generating the file fails, we don't want the test to succeed because there is an old left-over file. Cryptol supports shell commands (e.g., Alternatively, we could modify the |
Maybe we could make it produce output on stdout instead if you pass |
Well, in this case the regression test doesn't need to verify the contents of the file, only that the command ran successfully. The contents of the file are randomly-generated test vectors which are non-deterministic. I thought of having a stdout option, but the nondeterminism makes that tricky; what would the expected output be? |
I suppose we could specify something like |
Well, maybe it's overkill, but you could add an optional argument to seed the RNG. It would at least be deterministic then. |
Instead of an optional argument to |
@brianhuffman, #951 overlaps this PR, and I'd like to get it merged soon. Do we have a plan here? |
I'm fine with merging this PR as-is. In this case, the presence a leftover file will never make any difference to the success or failure of later runs of the regression test, so I don't think it's necessary to implement those other ideas we talked about just yet. |
The function now works as documented, and succeeds on function
types that do not have
Bit
as a return type.