Skip to content

Conversation

@aaronliu0130
Copy link
Member

@aaronliu0130 aaronliu0130 commented Nov 28, 2025

Clarified instructions on adding separate unit tests for the same regex pattern.

Original draft:

Throughout the unit tests, each part of the relevant regex pattern is only tested once. Do not add new test cases if the only difference to an existing test case is the replacement of a word already included as an alternate in a regex that is already tested. For example, there should be separate test cases for std::pair<int,int> and std::vector<int> even if they are part of the same regex, but after these two test cases are added, there should not be a separate test case for std::list<int> as it is simply testing the vector|list part of said regex.

Clarified instructions on adding separate unit tests for the same regex pattern.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds GitHub Copilot instructions for Python files to prevent duplication of unit tests that only differ by alternatives within the same regex alternation group. The instructions guide developers to test structural parts of regex patterns without exhaustively testing every alternative in an alternation.

Key Changes

  • Added new GitHub Copilot instruction file for Python files (.github/instructions/*.py.instructions.md)
  • Defined testing guidelines for regex pattern unit tests
  • Provided clear example using C++ standard library types to illustrate the principle

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@aaronliu0130 aaronliu0130 marked this pull request as draft November 28, 2025 20:35
@aaronliu0130
Copy link
Member Author

Perhaps we should drop this in favor of #416.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants