From 153f4fe284aeffeef7cb23f7da52b9d7cfdc94dd Mon Sep 17 00:00:00 2001 From: jithindasad Date: Wed, 12 May 2021 01:05:22 +0530 Subject: [PATCH] update tests for SecureRandom.base58 method --- activesupport/test/core_ext/secure_random_test.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/activesupport/test/core_ext/secure_random_test.rb b/activesupport/test/core_ext/secure_random_test.rb index 5003eff1d4..5b9f26adc8 100644 --- a/activesupport/test/core_ext/secure_random_test.rb +++ b/activesupport/test/core_ext/secure_random_test.rb @@ -10,6 +10,10 @@ class SecureRandomTest < ActiveSupport::TestCase assert_not_equal s1, s2 assert_equal 16, s1.length + assert_match(/^[a-zA-Z0-9]+$/, s1) + assert_match(/^[a-zA-Z0-9]+$/, s2) + assert_match(/^[^0OIl]+$/, s1) + assert_match(/^[^0OIl]+$/, s2) end def test_base58_with_length @@ -18,6 +22,10 @@ class SecureRandomTest < ActiveSupport::TestCase assert_not_equal s1, s2 assert_equal 24, s1.length + assert_match(/^[a-zA-Z0-9]+$/, s1) + assert_match(/^[a-zA-Z0-9]+$/, s2) + assert_match(/^[^0OIl]+$/, s1) + assert_match(/^[^0OIl]+$/, s2) end def test_base36