Repository navigation
Fix GenerateRandomWord producing non-ASCII letters in the Turkish culture - #997
Merged
StefH merged 2 commits intoNov 18, 2026
Merged
Conversation
…ture ParameterExpressionHelper.GenerateRandomWord lowercased the generated word with the current culture. With tr-TR the letter 'I' becomes the dotless 'ı', so the generated parameter name was no longer made of a-z only. Use ToLowerInvariant. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
StefH
requested changes
Nov 18, 2026
| // Assert | ||
| Check.That(result).Matches(@"[a-z]{16}"); | ||
| } | ||
|
|
Collaborator
There was a problem hiding this comment.
no need test this ; remove the test
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Removed the test in 06bb3b8; the PR is now just the |
StefH
approved these changes
Nov 18, 2026
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.
ParameterExpressionHelper.GenerateRandomWord()lowercases the generated word withToLower(), which uses the current culture. Under tr-TR,Ilowercases to the dotlessı(U+0131), so the word is no longer a-z only (e.g.vjcjjheccrwıeddd). These words are used as parameter names whenRenameEmptyParameterExpressionNamesis enabled; most generated words contain anI, so this happens on most calls.The fix is
ToLowerInvariant().Tests. On a tr-TR machine the existing suite already showed it: 15 tests failed on
master(ParameterExpressionHelper_GenerateRandom16CharWord,DynamicExpressionParser_ParseLambda_RenameEmptyParameterExpressionNames, and theParameterExpressionHelper_CreateParameterExpressioncases withrenameEmpty: true). I also addedParameterExpressionHelper_GenerateRandomWord_ShouldOnlyContainAsciiLettersInTurkishCulture, which sets tr-TR itself and checks 1000 words against^[a-z]{16}$, so it fails on any machine without the fix.System.Linq.Dynamic.Core.Testson net10.0: before the change 19 failed / 1267 passed; after it 0 failed / 1286 passed (17 skipped both times). I ran only the net10.0 test project (withIsRunningOnGitHubActions=trueto skip theuap10.0target locally).This change was written with Claude Code.
🤖 Generated with Claude Code