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

Add tests/issues.rs, test Issue #1096 (branch 0.4.x) #1097

Closed
wants to merge 1 commit into from

Conversation

jtmoon79
Copy link
Contributor

@jtmoon79 jtmoon79 commented May 28, 2023


If 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

  1. add test to tests/issues.rs demonstrating failure (add test attribute #[should_panic] if the issue causes a panic)
  2. code change with fix, adjust the test case for the fix

Issue-specific tests are not meant to replace "regular tests" or "general tests". Those should also be updated and augmented as necessary.

@jtmoon79 jtmoon79 force-pushed the issue_1096_and_tests branch from 6811804 to 5b157ab Compare May 28, 2023 20:12
@jtmoon79 jtmoon79 changed the title Add tests/issues.rs, test Issue #1096 Add tests/issues.rs, test Issue #1096 (branch 0.4.x) May 28, 2023
@jtmoon79 jtmoon79 marked this pull request as ready for review May 28, 2023 20:30
@djc
Copy link
Member

djc commented May 30, 2023

As explained in #1091 (comment), I'm not a fan.

@jtmoon79 jtmoon79 closed this Jun 4, 2023
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.

2 participants