Backport #7295 ยป 0001-backport-bug-6814.diff
ChangeLog | ||
---|---|---|
Mon Aug 6 19:15:11 2012 Masaki Suketa <masaki.suketa@nifty.ne.jp>
|
||
* test/win32ole/test_win32ole_variant.rb: setting WIN32OLE.locale
|
||
to pass some assertion. Thanks to Hiroshi Shirosaki.
|
||
[ruby-core:46873][Bug #6814]
|
||
Fri Oct 26 17:22:18 2012 NAKAMURA Usaku <usa@ruby-lang.org>
|
||
* file.c (append_fspath): need to set the encoding to result always.
|
test/win32ole/test_win32ole_variant.rb | ||
---|---|---|
if defined?(WIN32OLE_VARIANT)
|
||
class TestWIN32OLE_VARIANT < Test::Unit::TestCase
|
||
def setup
|
||
@orglocale = WIN32OLE.locale
|
||
WIN32OLE.locale = 0x0409 # set locale US-Eng
|
||
end
|
||
def teardown
|
||
WIN32OLE.locale = @orglocale
|
||
end
|
||
def test_s_new
|
||
obj = WIN32OLE_VARIANT.new('foo')
|
||
... | ... | |
def test_conversion_str2cy
|
||
begin
|
||
begin
|
||
WIN32OLE.locale = 0x0411 # set locale Japanese
|
||
rescue WIN32OLERuntimeError
|
||
STDERR.puts("\n#{__FILE__}:#{__LINE__}:#{self.class.name}.test_conversion_str2cy is skipped(Japanese locale is not installed)")
|
||
end
|
||
if WIN32OLE.locale == 0x0411
|
||
obj = WIN32OLE_VARIANT.new("\\10,000", WIN32OLE::VARIANT::VT_CY)
|
||
assert_equal("10000", obj.value)
|
||
end
|
||
ensure
|
||
WIN32OLE.locale = WIN32OLE::LOCALE_SYSTEM_DEFAULT
|
||
WIN32OLE.locale = 0x0411 # set locale Japanese
|
||
rescue WIN32OLERuntimeError
|
||
skip("Japanese locale is not installed")
|
||
end
|
||
if WIN32OLE.locale == 0x0411
|
||
obj = WIN32OLE_VARIANT.new("\\10,000", WIN32OLE::VARIANT::VT_CY)
|
||
assert_equal("10000", obj.value)
|
||
end
|
||
end
|
||