summaryrefslogtreecommitdiff
path: root/test/openssl/test_random.rb
blob: 33af375720f48b53d058d90f9443b88108273110 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true
require_relative "utils"

if defined?(OpenSSL)

class OpenSSL::TestRandom < OpenSSL::TestCase
  def test_random_bytes
    assert_equal("", OpenSSL::Random.random_bytes(0))
    assert_equal(12, OpenSSL::Random.random_bytes(12).bytesize)
  end

  def test_pseudo_bytes
    # deprecated as of OpenSSL 1.1.0
    assert_equal("", OpenSSL::Random.pseudo_bytes(0))
    assert_equal(12, OpenSSL::Random.pseudo_bytes(12).bytesize)
  end if OpenSSL::Random.methods.include?(:pseudo_bytes)
end

end
a href='/ruby.git/commit/vm_sync.h?id=79df14c04b452411b9d17e26a398e491bca1a811'>Introduce Ractor mechanism for parallel executionKoichi Sasada This commit introduces Ractor mechanism to run Ruby program in parallel. See doc/ractor.md for more details about Ractor. See ticket [Feature #17100] to see the implementation details and discussions. [Feature #17100] This commit does not complete the implementation. You can find many bugs on using Ractor. Also the specification will be changed so that this feature is experimental. You will see a warning when you make the first Ractor with `Ractor.new`. I hope this feature can help programmers from thread-safety issues. Notes: Merged: https://github.com/ruby/ruby/pull/3365