summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorglass <glass@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-28 08:49:25 +0000
committerglass <glass@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-28 08:49:25 +0000
commitdd8f7a6cfdce76078c1deb3d39e6f95edc1283c1 (patch)
tree1d6e283be15036c03e852f1f834bb7d3bda297aa /test
parent0a7785431c05d6b1854af94465f49c6b6d27a304 (diff)
* string.c: add internal API rb_str_locktmp_ensure().
* io.c (io_fread): use rb_str_locktmp_ensure(). [ruby-core:56121] [Bug #8669] * test/ruby/test_io.rb: add a test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_io.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb
index 469498cb0c..55e034e3a1 100644
--- a/test/ruby/test_io.rb
+++ b/test/ruby/test_io.rb
@@ -2801,4 +2801,18 @@ End
end
}
end if /mswin|mingw/ =~ RUBY_PLATFORM
+
+ def test_read_unlocktmp_ensure
+ bug8669 = '[ruby-core:56121] [Bug #8669]'
+
+ str = ""
+ r, = IO.pipe
+ t = Thread.new { r.read(nil, str) }
+ sleep 0.1 until t.stop?
+ t.raise
+ sleep 0.1 while t.alive?
+ assert_nothing_raised(RuntimeError, bug8669) { str.clear }
+ ensure
+ t.kill
+ end
end