summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2024-12-16 13:48:36 +0900
committergit <svn-admin@ruby-lang.org>2024-12-16 05:35:47 +0000
commit3a4433dddd4ba27d23feff83efd9d48604420df8 (patch)
tree0cf6d4a68222d88e1581b26cae866dfe34318763 /test
parent5e838197a318503c3d53f8662353ff29c5c3bd4a (diff)
[ruby/securerandom] Restore SecureRandom.alphanumeric same as Random::Formatter.alphanumeric of Ruby 3.3/3.4
Fixes https://github.com/ruby/securerandom/pull/35 https://github.com/ruby/securerandom/commit/fbb36e36cc
Diffstat (limited to 'test')
-rw-r--r--test/test_securerandom.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/test_securerandom.rb b/test/test_securerandom.rb
index 4c6bcf6f0e..765fbc9e0d 100644
--- a/test/test_securerandom.rb
+++ b/test/test_securerandom.rb
@@ -9,6 +9,12 @@ class TestSecureRandom < Test::Unit::TestCase
@it = SecureRandom
end
+ def test_alphanumeric_with_chars
+ assert_nothing_raised(ArgumentError) do
+ @it.alphanumeric(1, chars: ("0".."9").to_a)
+ end
+ end
+
# This test took 2 minutes on my machine.
# And 65536 times loop could not be enough for forcing PID recycle.
# TODO: We should run this test only on GitHub Actions.