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

ruby-changes:9601

From: akr <ko1@a...>
Date: Mon, 29 Dec 2008 01:10:09 +0900 (JST)
Subject: [ruby-changes:9601] Ruby:r21141 (trunk): add a test for OpenSSL::SSL::SSLSocket#read_nonblock.

akr	2008-12-29 01:09:59 +0900 (Mon, 29 Dec 2008)

  New Revision: 21141

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

  Log:
    add a test for OpenSSL::SSL::SSLSocket#read_nonblock.

  Modified files:
    trunk/test/openssl/test_pair.rb

Index: test/openssl/test_pair.rb
===================================================================
--- test/openssl/test_pair.rb	(revision 21140)
+++ test/openssl/test_pair.rb	(revision 21141)
@@ -144,6 +144,18 @@
     }
   end
 
+  def test_read_nonblock
+    ssl_pair {|s1, s2|
+      assert_raise(Errno::EWOULDBLOCK) { s2.read_nonblock(10) }
+      s1.write "abc\ndef\n"
+      assert_equal("ab", s2.read_nonblock(2))
+      assert_equal("c\n", s2.gets)
+      ret = nil
+      assert_nothing_raised("[ruby-core:20298]") { ret = s2.read_nonblock(10) }
+      assert_equal("def\n", ret)
+    }
+  end
+
 end
 
 end

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

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