Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Class of char wrongly parsed #67

Open
bkqc opened this issue Jun 20, 2024 · 0 comments
Open

Class of char wrongly parsed #67

bkqc opened this issue Jun 20, 2024 · 0 comments
Labels

Comments

@bkqc
Copy link

bkqc commented Jun 20, 2024

I have this code using Xeger package 2.2.1 that I used to test an AutoFixture call that is often crashing (this RegEx is normally in a RegularExpressionAttribute annotation).
new Fare.Xeger(@"^\s*[0-9\s]{0,6}\s*$").Generate();
that generates this C# string.
" s\t \t "

Obviously, the character "s" is not valid using this RegEx.

To reproduce, I called the previous code multiple time in the Execution window in Visual Studio 2022. The global results were

new Fare.Xeger(@"^\s*[0-9\s]{0,6}\s*$").Generate();
""
new Fare.Xeger(@"^\s*[0-9\s]{0,6}\s*$").Generate();
""
new Fare.Xeger(@"^\s*[0-9\s]{0,6}\s*$").Generate();
"  s\t \t  "
new Fare.Xeger(@"^\s*[0-9\s]{0,6}\s*$").Generate();
"4\t\t"

NB
Note how the [0-9\s] part is almost never used. This seems bad in a randomized context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants