test: add regression tests for quoted phrases with reserved words#1108
Merged
test: add regression tests for quoted phrases with reserved words#1108
Conversation
The known issue "Quoted Phrases Don't Escape Operators" was already fixed in a previous commit. This PR adds 7 regression tests to prevent future regressions and documents the fix in KNOWN-ISSUES.md. Tests verify that quoted phrases like "Alice AND Bob" correctly search for the literal text instead of treating AND/OR/NOT as operators.
87fe1a6 to
c583d76
Compare
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.
Summary
The known issue "Quoted Phrases Don't Escape Operators" was already fixed in a previous commit. This PR adds regression tests and documents the resolution.
Changes
tests/Core.Tests/Search/SearchEndToEndTests.cs: Added 7 E2E regression tests:KnownIssue2_QuotedPhraseWithAND_FindsExactPhraseKnownIssue2_QuotedPhraseWithOR_FindsExactPhraseKnownIssue2_QuotedPhraseWithNOT_FindsExactPhraseKnownIssue2_QuotedReservedWordAND_FindsDocumentsContainingANDKnownIssue2_QuotedReservedWordOR_FindsDocumentsContainingORKnownIssue2_QuotedReservedWordNOT_FindsDocumentsContainingNOTKnownIssue2_MixedQuotedPhraseAndOperator_WorksCorrectlyKNOWN-ISSUES.md: Moved issue to "Resolved Issues" sectiontests/Main.Tests/Integration/ExamplesCommandE2ETests.cs: Updated commentsHow it works
The tokenizer in
InfixQueryParser.cscorrectly identifies quoted strings and preserves their content as literal text. The FTS query extractor properly quotes phrases and escapes reserved words when generating FTS5 queries.Test plan
build.shpasses with 0 warningsformat.shpassescoverage.shpasses