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

Use golden tests #4

Open
Hasenn opened this issue Mar 12, 2021 · 0 comments
Open

Use golden tests #4

Hasenn opened this issue Mar 12, 2021 · 0 comments
Labels
good first issue Good for newcomers

Comments

@Hasenn
Copy link
Collaborator

Hasenn commented Mar 12, 2021

https://docs.rs/goldentests/0.3.7/goldentests/

Why golden tests?
Golden tests allow you to specify the output of some command within a file and automatically ensure that that output doesn't change. If it does, goldentests will show an error-diff showing the expected and actual output. This way, whenever the output of something changes a human can see the change and decide if it should be kept or is a bug and should be reverted.

What are golden tests useful for?
Golden tests are especially useful for applications that take a file as input and produce output of some kind. For example: compilers and config-parsers (well, parsers in general) are two such applications that can benefit form automated golden tests. In the case of a config parser, you would be able to provide many config examples as tests and ensure that your parser was able to read the files with the expected stdout/stderr output and exit code.

@Hasenn Hasenn added the good first issue Good for newcomers label Mar 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant