Bug #6965 ยป fix_test_pstore.patch
test/ruby/envutil.rb | ||
---|---|---|
return stdout, stderr, status
|
||
end
|
||
ensure
|
||
[in_c, in_p, out_c, out_p, err_c, err_p].each do |io|
|
||
io.close if io && !io.closed?
|
||
end
|
||
[th_stdout, th_stderr].each do |th|
|
||
(th.kill; th.join) if th
|
||
end
|
||
[in_c, in_p, out_c, out_p, err_c, err_p].each do |io|
|
||
io.close if io && !io.closed?
|
||
end
|
||
end
|
||
module_function :invoke_ruby
|
||
test/test_pstore.rb | ||
---|---|---|
def test_pstore_files_are_accessed_as_binary_files
|
||
bug5311 = '[ruby-core:39503]'
|
||
n = 128
|
||
assert_in_out_err(["-Eutf-8:utf-8", "-rpstore", "-", @pstore_file], <<-SRC, [bug5311], [], bug5311)
|
||
assert_in_out_err(["-Eutf-8:utf-8", "-rpstore", "-", @pstore_file], <<-SRC, [bug5311], [], bug5311, timeout: 15)
|
||
@pstore = PStore.new(ARGV[0])
|
||
(1..#{n}).each do |i|
|
||
@pstore.transaction {@pstore["Key\#{i}"] = "value \#{i}"}
|