cieslarmichal / faker-cxx

C++ Faker library for generating fake (but realistic) data.
https://cieslarmichal.github.io/faker-cxx/
MIT License
308 stars 146 forks source link

Add String guarantees #233

Closed cieslarmichal closed 10 months ago

cieslarmichal commented 11 months ago

Extend all functions from String module to support generation guarantees. Example1: generated string contains at least 1 ‘\’. Example2: generated string contains 1 ‘.’ and 1 ','. Example3: generated string contains at least 3 ‘9’.

cieslarmichal commented 11 months ago

assigned @braw-lee

cieslarmichal commented 11 months ago

discussion https://github.com/cieslarmichal/faker-cxx/discussions/313

braw-lee commented 11 months ago

Please look at String::alphanumeric(). It has a parameter : std::string& excludeCharacters, which is useless once we add string guarantee as users can just pass a char with atmost count as zero to the GuaranteeMap to ensure char is excluded. So should I remove it while adding string guarantee overload or keep it as it is? @cieslarmichal

cieslarmichal commented 11 months ago

I think we could have it too, because it would be more intuitive for some users, just overload it :)

cieslarmichal commented 11 months ago

@braw-lee I have just added a new task with guarantees (for password) :) https://github.com/cieslarmichal/faker-cxx/issues/352