ruby-changes:3841
From: ko1@a...
Date: Tue, 29 Jan 2008 23:36:22 +0900 (JST)
Subject: [ruby-changes:3841] usa - Ruby:r15330 (trunk): * test/win32ole/test_win32ole.rb: ruby's encoding support.
usa 2008-01-29 23:36:14 +0900 (Tue, 29 Jan 2008) New Revision: 15330 Modified files: trunk/test/win32ole/test_win32ole.rb Log: * test/win32ole/test_win32ole.rb: ruby's encoding support. http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/test/win32ole/test_win32ole.rb?r1=15330&r2=15329&diff_format=u Index: test/win32ole/test_win32ole.rb =================================================================== --- test/win32ole/test_win32ole.rb (revision 15329) +++ test/win32ole/test_win32ole.rb (revision 15330) @@ -42,17 +42,17 @@ exc = assert_raise(WIN32OLERuntimeError) { @dict1.add } - assert_match(/^\(in OLE method `add': \)/, exc.message) + assert_match(/^\(in OLE method `add': \)/, exc.message) #` exc = assert_raise(WIN32OLERuntimeError) { @dict1._invoke(1, [], []) } - assert_match(/^\(in OLE method `<dispatch id:1>': \)/, exc.message) + assert_match(/^\(in OLE method `<dispatch id:1>': \)/, exc.message) #` exc = assert_raise(WIN32OLERuntimeError) { @dict1.compareMode = -1 } - assert_match(/^\(in setting property `compareMode': \)/, exc.message) + assert_match(/^\(in setting property `compareMode': \)/, exc.message) #` end def test_ole_methods @@ -156,7 +156,7 @@ exc = assert_raise(WIN32OLERuntimeError) { WIN32OLE.new("{000}") } - assert_match(/unknown OLE server: `\{000\}'/, exc.message) + assert_match(/unknown OLE server: `\{000\}'/, exc.message) #` end def test_s_connect @@ -279,14 +279,14 @@ begin WIN32OLE.codepage = WIN32OLE::CP_UTF8 obj = WIN32OLE_VARIANT.new([0x3042].pack("U*")) - assert_equal("\xE3\x81\x82", obj.value) + assert_equal("\xE3\x81\x82".force_encoding("CP65001"), obj.value) begin WIN32OLE.codepage = 932 # Windows-31J rescue WIN32OLERuntimeError end if (WIN32OLE.codepage == 932) - assert_equal("\x82\xA0", obj.value) + assert_equal("\x82\xA0".force_encoding("CP932"), obj.value) end begin @@ -294,7 +294,7 @@ rescue WIN32OLERuntimeError end if (WIN32OLE.codepage == 20932) - assert_equal("\xA4\xA2", obj.value) + assert_equal("\xA4\xA2".force_encoding("CP20932"), obj.value) end WIN32OLE.codepage = WIN32OLE::CP_UTF8 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/