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

Improve test coverage #20

Merged
merged 2 commits into from Mar 26, 2024
Merged

Improve test coverage #20

merged 2 commits into from Mar 26, 2024

Conversation

nicholasbishop
Copy link
Contributor

@nicholasbishop nicholasbishop commented Mar 24, 2024

All reachable branches in the encoding/decoding functions are now checked. We can't check every branch, because some are intentionally unreachable (if reached, would indicate an invalid str which is UB). Checked with cargo +nightly llvm-cov --html --branch --open (using https://github.com/taiki-e/cargo-llvm-cov).

Also move the tests to tests/tests.rs -- this ensures we're testing the public API in the same way it would be used when using the crate as a dependency. The library is very small so right now it doesn't make much difference, but in an upcoming PR I want to add a macro, and I think those are better to test this way.

@phip1611
Copy link
Contributor

phip1611 commented Mar 25, 2024

Thanks for working on this!

Unfortunately, I don't have that much time in the last couple of months. But I'm still happy to review

All reachable branches in the encoding/decoding functions are now
checked.
This ensures the tests are only using the public API of the crate.
@phip1611 phip1611 merged commit 7cef0df into main Mar 26, 2024
4 checks passed
@phip1611 phip1611 deleted the bishop-coverage branch March 26, 2024 01:51
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.

None yet

2 participants