diff options
author | suke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-01-29 12:41:50 +0000 |
---|---|---|
committer | suke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-01-29 12:41:50 +0000 |
commit | 883f34f7776b68f9c0090ce59f03923a5ee66fbe (patch) | |
tree | 1d96fff4e1b27c9f41c10755afe7fb8ce85de211 /test/win32ole/test_win32ole.rb | |
parent | 024c694c9519cdeffdc410b137db87b33d41a0b3 (diff) | |
download | ruby-883f34f7776b68f9c0090ce59f03923a5ee66fbe.tar.gz |
* 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
Diffstat (limited to 'test/win32ole/test_win32ole.rb')
-rw-r--r-- | test/win32ole/test_win32ole.rb | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/test/win32ole/test_win32ole.rb b/test/win32ole/test_win32ole.rb index 1c523a3627..bcfd63f4ea 100644 --- a/test/win32ole/test_win32ole.rb +++ b/test/win32ole/test_win32ole.rb @@ -296,6 +296,38 @@ if defined?(WIN32OLE) end end + def test_s_locale + assert_equal(WIN32OLE::LOCALE_SYSTEM_DEFAULT, WIN32OLE.locale) + end + + def test_s_locale_set + begin + WIN32OLE.locale = 1041 + assert_equal(1041, WIN32OLE.locale) + WIN32OLE.locale = WIN32OLE::LOCALE_SYSTEM_DEFAULT + assert_raise(WIN32OLERuntimeError) { + WIN32OLE.locale = 111 + } + assert_equal(WIN32OLE::LOCALE_SYSTEM_DEFAULT, WIN32OLE.locale) + ensure + WIN32OLE.locale = WIN32OLE::LOCALE_SYSTEM_DEFAULT + end + end + + def test_s_locale_change + begin + WIN32OLE.locale = 0x0411 + obj = WIN32OLE_VARIANT.new("\\100,000", WIN32OLE::VARIANT::VT_CY) + assert_equal("100000", obj.value) + + WIN32OLE.locale = 1033 + obj = WIN32OLE_VARIANT.new("$100,000", WIN32OLE::VARIANT::VT_CY) + assert_equal("100000", obj.value) + ensure + WIN32OLE.locale = WIN32OLE::LOCALE_SYSTEM_DEFAULT + end + end + def test_const_CP_ACP assert_equal(0, WIN32OLE::CP_ACP) end @@ -323,6 +355,14 @@ if defined?(WIN32OLE) def test_const_CP_UTF8 assert_equal(65001, WIN32OLE::CP_UTF8) end + + def test_const_LOCALE_SYSTEM_DEFAULT + assert_equal(0x0800, WIN32OLE::LOCALE_SYSTEM_DEFAULT); + end + + def test_const_LOCALE_USER_DEFAULT + assert_equal(0x0400, WIN32OLE::LOCALE_USER_DEFAULT); + end end # test of subclass of WIN32OLE |