aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_securerandom.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-21 16:12:46 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-21 16:12:46 +0000
commit6cba29b4220cc0277f209af9d172f4ec1ddb5f0e (patch)
tree4324a47627dba6650cc4797b9d26969c25f2092c /test/test_securerandom.rb
parent2c27e52f8ebdf4d382a12b224707d14f2ca589ed (diff)
downloadruby-6cba29b4220cc0277f209af9d172f4ec1ddb5f0e.tar.gz
less random generations in Random::Formatter#choose.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60309 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/test_securerandom.rb')
-rw-r--r--test/test_securerandom.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/test/test_securerandom.rb b/test/test_securerandom.rb
index 9b2c8a5e67..5f08182115 100644
--- a/test/test_securerandom.rb
+++ b/test/test_securerandom.rb
@@ -144,9 +144,10 @@ end
end
def test_alphanumeric
- 65.times do |idx|
- an = @it.alphanumeric
- assert_match(/^[0-9a-zA-Z]+$/, an)
+ 65.times do |n|
+ an = @it.alphanumeric(n)
+ assert_match(/^[0-9a-zA-Z]*$/, an)
+ assert_equal(n, an.length)
end
end