-
Notifications
You must be signed in to change notification settings - Fork 545
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
add tests for panics found by @Koral77 (branch 0.4.x) #1091
Conversation
Why do some of these tests panic while they are fixed? |
🤷 That's why it's good to add Issue-specific tests so the issue is definitively known. As the code is fixed, the |
I have added tests for these issues when fixing the panics. Maybe best to not add these invalid cases? |
With the panics fixed in #1093, |
857d1e0
to
8650193
Compare
Good review @pitdicker . Indeed, I was hasty in throwing in the code from the examples. I updated the cases to be more sensible. What do you think? These tests are somewhat redundant. However, I'd like to move toward a project habit of adding useful test cases per issue. It gives the project higher "quality confidence". Hopefully @djc agrees. |
I'm not interested in adding "negative" tests (that test that some behavior still panics). Honestly, I'm not a big fan of the current (proposed) practice for doing issue tests. For one thing, it's annoying to name tests by their issue number instead of giving them a somewhat descriptive (while hopefully still concise) name that describes what behavior their testing, because it means it's harder to determine what the test is trying to cover. Instead, add a comment linking to an issue. Also, we should keep tests closer to the code they cover (typically in a unit test, not in an integration test) rather than keeping a separate suite of "issues" test. Also, while I think it's somewhat useful to add tests to cover issues that apparently went undetected for a long time, the more important thing we should probably do is setup coverage (using cargo-llvm-cov reporting into codecov.io) to track that new tests actually increase coverage. |
Issue #1010