Skip to content
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

Idempotent mode for script tests #198

Closed
julianhyde opened this issue Jul 29, 2023 · 0 comments
Closed

Idempotent mode for script tests #198

julianhyde opened this issue Jul 29, 2023 · 0 comments

Comments

@julianhyde
Copy link
Collaborator

Add idempotent mode for script tests. Currently a test such as simple.sml has a corresponding simple.sml.out file. With this change, the script would be simple.smli and the output would be simple.smli (in another directory). The test succeeds if the two files are identical.

@julianhyde julianhyde changed the title Add idempotent mode for script tests Idempotent mode for script tests Jul 29, 2023
julianhyde added a commit to julianhyde/morel that referenced this issue Jul 29, 2023
To date, scripts had .sml suffix and were accompanied by a
reference log with .sml.out suffix; with this change, scripts
may have a .smli suffix, and such scripts can have expected
output interleaved, and therefore no reference file is needed.
The expected output is on lines prefixed '> ', and is ignored
when reading commands from the file.

If the script is successful, the generated .smli file will
match the source .smli file; if the generated file contains
the correct output, you should copy the generated file, so
that it becomes the new source.

Idempotent scripts are easier to read (the expected output
is right there) and merge (you can inspect and manually merge
expected output, rather than re-generating the output and
hoping for the best).

Fixes hydromatic#198
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant