-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: run snapshot tests dynamically in unimarkup-core crate #105
Conversation
2176dcf
to
5c81e6a
Compare
1cb0637
to
e51fb1a
Compare
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.
Thanks for this PR.
The blocks.rs
file in core
seems to be missing the snapshot test runner.
At the moment, only spec tests are run if I am correct.
Everything else looks ready to be merged.
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 good now.
Just not sure about case2
as variable name.
But I can change that myself once I merge #106 with these changes.
There will be some merge conflicts anyways, because of the Scanner change.
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.
thanks 😊
looks good now 👍
This PR adds dynamic testing of snapshots in
unimarkup_core
crate.By dynamic is meant that all spec files are automatically collected, parsed in order to generate test cases, and these test cases are run. Snapshot files are automatically created, and each test case (where each spec yaml file can contain multiple tests) is reported in
cargo test
output with corresponding name (and module path).Downside of using custom harness is that using
#[test]
attribute to automatically test functions does not work (as far as I know). Any custom function must be manually collected. Seetest_fn!
macro and how it's used.Closes #100.