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

lorem().characters() method sometimes does not include digit. #759

Open
swaroop-tata opened this issue Jun 9, 2023 · 4 comments
Open

lorem().characters() method sometimes does not include digit. #759

swaroop-tata opened this issue Jun 9, 2023 · 4 comments

Comments

@swaroop-tata
Copy link

Describe the bug
lorem().characters() method sometimes does not include digit.

To Reproduce
Run "lorem().characters(7,true,true)" this in a loop. Observe that some times, the generated string will miss digit.

Expected behavior
A digit must include every time when includeDigit is used.

Versions:

  • OS: Windows
  • JDK 11
  • Faker Version 1.0.2

Additional context

@bodiam
Copy link

bodiam commented Jun 9, 2023

You'd best use https://github.com/datafaker-net/datafake instead, which is an active fork of this library.

@bodiam
Copy link

bodiam commented Jun 9, 2023

I don't think this is a bug though, it's an option to include numbers. Not always they will be included. If you want to force numbers, you can use something like bothify, regexify, or examplify.

@swaroop-tata
Copy link
Author

Thank you for the response.

@snuyanzin
Copy link
Contributor

In datafaker there is a special Text provider where it's possible to specify minimum number of occurrencies per symbol. I guess, even more it's possible to specify other symbols e.g. from non English abc, it will satisfy your case.
For more details https://github.com/datafaker-net/datafaker/blob/main/src/test/java/net/datafaker/providers/base/TextTest.java

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

No branches or pull requests

3 participants