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

tools: add golden tests to validate the parser #105

Merged
merged 1 commit into from
Aug 23, 2023

Conversation

TristanCacqueray
Copy link
Collaborator

Fixes #100

@frasertweedale
Copy link
Collaborator

Thanks for kicking this off Tristan. I'd rather not use golden tests, because the "golden" output will likely change frequently, especially as we are still in early stages of tool development. It will be a headache updating the tests.

Could we instead use example-based tests of inputs that are expected to parse or not parse, with some simple content checks for the success scenarios? (e.g., lists contain the expected values or are the expected length)

@TristanCacqueray
Copy link
Collaborator Author

@frasertweedale I don't get how this causes a headache to maintain since this is done automatically when running with --test-option=--accept. And when comparing new outputs, we have a chance to spot unexpected diff. It sounds more tedious to create and maintain the simple content checks.

However success scenarios do produce a bit of data, so it might be more efficient to use direct checks. Perhaps we could use both strategies?

@frasertweedale
Copy link
Collaborator

Oh, I wasn't aware there was an option to just accept and apply the updated output. In that case, it's OK by me.

@TristanCacqueray
Copy link
Collaborator Author

@frasertweedale can we land this now?

@frasertweedale
Copy link
Collaborator

Yes. Changes will come with the TOML lib change, but no reason not to land this now and just update the other MR. Better to have the tests in place sooner :)

@frasertweedale frasertweedale merged commit c281658 into haskell:main Aug 23, 2023
14 checks passed
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

Successfully merging this pull request may close these issues.

add tests for advisory parsing
3 participants