Better string input randomization

This commit is contained in:
2024-01-06 01:05:28 +01:00
parent 5c70736a91
commit d1bfabc105
2 changed files with 6 additions and 3 deletions

View File

@@ -16,7 +16,7 @@ class ActiveSupport::TestCase
SecureRandom.class_eval do
def self.random_symbol(n = 10)
# Unicode characters: 32-126, 160-383
choose([*' '..'~', 160.chr, *'¡'..'ſ'], n)
choose([*' '..'~', 160.chr(Encoding::UTF_8), *'¡'..'ſ'], n)
end
end