Project

General

Profile

Feature #10849 ยป test_securerandom.patch

View differences:

test/test_securerandom.rb
164 164
    end
165 165
  end
166 166

  
167
  def test_choose
168
    65.times do |idx|
169
      ch = @it.choose([*'a'..'e', *'0'..'5'])
170
      assert_match(/^[a-e0-5]+$/, ch)
171
    end
172
  end
173

  
174
  def test_graph
175
    65.times do |idx|
176
      g = @it.graph
177
      assert_match(/^[!-~]+$/, g)
178
    end
179
  end
180

  
181
  def test_alphanumeric
182
    65.times do |idx|
183
      an = @it.alphanumeric
184
      assert_match(/^[0-9a-zA-Z]+$/, an)
185
    end
186
  end
187

  
167 188
  def protect
168 189
    begin
169 190
      yield