Add tests/issues.rs, test Issue #1096 (branch 0.4.x) #1097
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
tests/issues.rs
for regression tests specific to issues.NaiveDateTime
asRFC3339
gives a bad-explaining error #1096If this PR is accepted, I will add another PR that moves all issue-specific tests into
tests/issues.rs
.IMO, the issue-specific tests just make better sense in their own file. Since they cover niche topics it's often hard to know where to put issue-specific tests or what to title them. This code organization, placing them in
tests/issues.rs
, makes it easier to quickly add useful user-provided regression tests in a more organized manner.User-provided issue-specific tests provide valuable certainty that a particular issue has been fixed.
They also exercise often niche behaviors that is too specific for "regular tests" to cover. Users spend a fair amount of time discovering then isolating an issue. Why not put that hard-won knowledge to use as another assurance of quality?
Issue-specific tests also demonstrate code-use for other users running into similar problems or with related questions.
I don't plan to add a test for all issues from the Issue backlog. But maybe going forward it can be made into a project practice that every fixed Issue gets a new test case in
tests/issues.rs
when that issue has reasonably simple reproduction steps provided,e.g. a commit pattern like
tests/issues.rs
demonstrating failure (add test attribute#[should_panic]
if the issue causes a panic)Issue-specific tests are not meant to replace "regular tests" or "general tests". Those should also be updated and augmented as necessary.