mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/win32ole/win32ole.c: add WIN32OLE.locale=, WIN32OLE.locale,
WIN32OLE_VARIANT#vartype. * test/win32ole/test_win32ole.rb: add test for WIN32OLE.locale=, WIN32OLE.locale. * test/win32ole/test_win32ole_variant.rb: add test for WIN32OLE_VARIANT#vartype. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11588 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
024c694c95
commit
883f34f777
4 changed files with 178 additions and 21 deletions
|
@ -81,8 +81,13 @@ if defined?(WIN32OLE_VARIANT)
|
|||
end
|
||||
|
||||
def test_conversion_str2cy
|
||||
obj = WIN32OLE_VARIANT.new("\\10,000", WIN32OLE::VARIANT::VT_CY)
|
||||
assert_equal("10000", obj.value)
|
||||
begin
|
||||
WIN32OLE.locale = 0x0411 # set locale Japanese
|
||||
obj = WIN32OLE_VARIANT.new("\\10,000", WIN32OLE::VARIANT::VT_CY)
|
||||
assert_equal("10000", obj.value)
|
||||
ensure
|
||||
WIN32OLE.locale = WIN32OLE::LOCALE_SYSTEM_DEFAULT
|
||||
end
|
||||
end
|
||||
|
||||
def test_create_vt_array
|
||||
|
@ -105,6 +110,7 @@ if defined?(WIN32OLE_VARIANT)
|
|||
assert_equal([65, 0].pack("C*"), obj.value)
|
||||
|
||||
end
|
||||
|
||||
def test_create_vt_array_int
|
||||
obj = WIN32OLE_VARIANT.new([65, 0], WIN32OLE::VARIANT::VT_ARRAY|WIN32OLE::VARIANT::VT_UI1)
|
||||
assert_equal([65, 0].pack("C*"), obj.value)
|
||||
|
@ -126,6 +132,11 @@ if defined?(WIN32OLE_VARIANT)
|
|||
assert_equal("Str", obj.value);
|
||||
end
|
||||
|
||||
def test_vartype
|
||||
obj = WIN32OLE_VARIANT.new("Str")
|
||||
assert_equal(WIN32OLE::VARIANT::VT_BSTR, obj.vartype)
|
||||
end
|
||||
|
||||
def test_c_nothing
|
||||
assert_nil(WIN32OLE_VARIANT::Nothing.value)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue