Repository navigation
Add regression doctests for KMP search and failure arrays - #15546
Open
Miladkhoshdel wants to merge 1 commit into
Open
Miladkhoshdel wants to merge 1 commit into
Miladkhoshdel wants to merge 1 commit into
Conversation
12 of 15 tasks
12 of 15 tasks
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Describe your change
Add regression doctests for empty-pattern handling in
knuth_morris_pratt()and examples forget_failure_array().The search tests verify that an empty pattern returns
0for both empty and nonempty text, consistent withstr.find(). The helper tests cover distinct characters and overlapping prefixes.This PR changes only doctests in one algorithm file.
Dependency: #15545 must merge first. Without that fix, the two empty-pattern doctests fail. After it merges, this branch should be updated before running CI again.
Validation:
get_failure_array()doctests pass.git diff --checkpasses.Checklist