diff options
Diffstat (limited to 'test/win32ole/test_win32ole_variant.rb')
-rw-r--r-- | test/win32ole/test_win32ole_variant.rb | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/test/win32ole/test_win32ole_variant.rb b/test/win32ole/test_win32ole_variant.rb index 6b7d72fcc2..b00052e534 100644 --- a/test/win32ole/test_win32ole_variant.rb +++ b/test/win32ole/test_win32ole_variant.rb @@ -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 |