mirror of
https://github.com/ruby/ruby.git
synced 2025-09-17 09:33:59 +02:00
merge from trunk (r27887-r27889)
* test/win32ole/test_folderitem2_invokeverb.rb (test_invokeverb): should use assert_equal instead of assert in such cases. * test/dl/test_func.rb (test_sinf): sinf() doesn't exist in the standard of C. * test/csv/test_interface.rb (test_write_hash): may need to set binary mode when converter is specified. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@27901 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
7098740753
commit
c2ff169664
3 changed files with 13 additions and 9 deletions
|
@ -167,14 +167,14 @@ class TestCSVInterface < Test::Unit::TestCase
|
||||||
File.unlink(@path)
|
File.unlink(@path)
|
||||||
|
|
||||||
lines = [{a: 1, b: 2, c: 3}, {a: 4, b: 5, c: 6}]
|
lines = [{a: 1, b: 2, c: 3}, {a: 4, b: 5, c: 6}]
|
||||||
CSV.open( @path, "w", headers: true,
|
CSV.open( @path, "wb", headers: true,
|
||||||
header_converters: :symbol ) do |csv|
|
header_converters: :symbol ) do |csv|
|
||||||
csv << lines.first.keys
|
csv << lines.first.keys
|
||||||
lines.each { |line| csv << line }
|
lines.each { |line| csv << line }
|
||||||
end
|
end
|
||||||
CSV.open( @path, "r", headers: true,
|
CSV.open( @path, "rb", headers: true,
|
||||||
converters: :all,
|
converters: :all,
|
||||||
header_converters: :symbol ) do |csv|
|
header_converters: :symbol ) do |csv|
|
||||||
csv.each { |line| assert_equal(lines.shift, line.to_hash) }
|
csv.each { |line| assert_equal(lines.shift, line.to_hash) }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -22,8 +22,12 @@ module DL
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_sinf
|
def test_sinf
|
||||||
f = Function.new(CFunc.new(@libm['sinf'], TYPE_FLOAT, 'sinf'),
|
begin
|
||||||
[TYPE_FLOAT])
|
f = Function.new(CFunc.new(@libm['sinf'], TYPE_FLOAT, 'sinf'),
|
||||||
|
[TYPE_FLOAT])
|
||||||
|
rescue DL::DLError
|
||||||
|
skip "libm may not have sinf()"
|
||||||
|
end
|
||||||
assert_in_delta 1.0, f.call(90 * Math::PI / 180), 0.0001
|
assert_in_delta 1.0, f.call(90 * Math::PI / 180), 0.0001
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,7 @@ if defined?(WIN32OLE)
|
||||||
# is found in context menu,
|
# is found in context menu,
|
||||||
if @shortcut
|
if @shortcut
|
||||||
links = find_link(@dummy_path)
|
links = find_link(@dummy_path)
|
||||||
assert(0, links.size)
|
assert_equal(0, links.size)
|
||||||
|
|
||||||
# Now create shortcut to @dummy_path
|
# Now create shortcut to @dummy_path
|
||||||
arg = WIN32OLE_VARIANT.new(@shortcut)
|
arg = WIN32OLE_VARIANT.new(@shortcut)
|
||||||
|
@ -72,7 +72,7 @@ if defined?(WIN32OLE)
|
||||||
|
|
||||||
# Now search shortcut to @dummy_path
|
# Now search shortcut to @dummy_path
|
||||||
links = find_link(@dummy_path)
|
links = find_link(@dummy_path)
|
||||||
assert(1, links.size)
|
assert_equal(1, links.size)
|
||||||
@lpath = links[0].path
|
@lpath = links[0].path
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue