[前][次][番号順一覧][スレッド一覧]

ruby-changes:37496

From: nobu <ko1@a...>
Date: Thu, 12 Feb 2015 18:37:00 +0900 (JST)
Subject: [ruby-changes:37496] nobu:r49577 (trunk): test_random.rb: add

nobu	2015-02-12 18:36:55 +0900 (Thu, 12 Feb 2015)

  New Revision: 49577

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=49577

  Log:
    test_random.rb: add
    
    * test/openssl/test_random.rb (OpenSSL::TestRandom): add minimum
      tests.

  Added files:
    trunk/test/openssl/test_random.rb
Index: test/openssl/test_random.rb
===================================================================
--- test/openssl/test_random.rb	(revision 0)
+++ test/openssl/test_random.rb	(revision 49577)
@@ -0,0 +1,16 @@ https://github.com/ruby/ruby/blob/trunk/test/openssl/test_random.rb#L1
+begin
+  require "openssl"
+rescue LoadError
+end
+
+class OpenSSL::TestRandom < Test::Unit::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
+    assert_equal("", OpenSSL::Random.pseudo_bytes(0))
+    assert_equal(12, OpenSSL::Random.pseudo_bytes(12).bytesize)
+  end
+end if defined?(OpenSSL::Random)

Property changes on: test/openssl/test_random.rb
___________________________________________________________________
Added: svn:eol-style
   + LF


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]