Method: PropCheck::Generators.printable_string
- Defined in:
- lib/prop_check/generators.rb
.printable_string(**kwargs) ⇒ Object
Generates a printable string both ASCII characters and Unicode.
Shrinks towards shorter strings, and towards characters with lower codepoints, e.g. ASCII
>> Generators.printable_string.sample(5, size: 10, rng: Random.new(42))
=> ["", "Ȍ", "𐁂", "Ȕ", ""]
Accepts the same options as array
613 614 615 |
# File 'lib/prop_check/generators.rb', line 613 def printable_string(**kwargs) array(printable_char, **kwargs).map(&:join) end |