Use QueryContentLocale for locale detection in tests - #4610
Conversation
Replaced QueryKeywordLocale with QueryContentLocale to ensure tests adapt to the system's content locale, improving reliability across environments. Clarified a comment for better readability.
📝 WalkthroughWalkthroughThe Windows Search query test now uses ChangesExplorer locale test
Estimated code review effort: 1 (Trivial) | ~2 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Updates the Windows Index search unit test to derive the expected CONTAINS(..., LCID) locale from the system at runtime, avoiding hard-coded assumptions that can break on non–en-US environments.
Changes:
- Switches locale substitution in
ExplorerTestfromQueryKeywordLocaletoQueryContentLocaleto match how the generated SQL uses LCIDs. - Clarifies/standardizes a test comment (
// When).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
DavidGBrett
left a comment
There was a problem hiding this comment.
LGTM!
Thanks for the fix
Replaced QueryKeywordLocale with QueryContentLocale to ensure tests adapt to the system's content locale, improving reliability across environments. Clarified a comment for better readability.
Under my system with Chinese locale, I happened to find that explorer test failed. So this a quick fix for that.
Summary by cubic
Switch Explorer tests to use
QueryContentLocalewith invariant formatting so LCID assertions match the system content locale across machines.Summary of changes
QueryKeywordLocalewithQueryContentLocalefor LCID substitution; usedToString(CultureInfo.InvariantCulture); minor comment/format tweaks.1033) assumption in assertions.Release Note
No user-facing changes; improves test reliability on non‑en‑US systems.
Written for commit 45d9cf8. Summary will update on new commits.