mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/win32ole/tests/testWIN32OLE.rb: add test for WIN32OLE.codepage=
* ext/win32ole/tests/testOLETYPELIB.rb: correct expected message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8334 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
6a63e942ba
commit
9f6d8980ff
3 changed files with 24 additions and 2 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
Fri Apr 15 22:40:19 2005 Masaki Suketa <masaki.suketa@nifty.ne.jp>
|
||||||
|
|
||||||
|
* ext/win32ole/tests/testWIN32OLE.rb: add test for WIN32OLE.codepage=
|
||||||
|
|
||||||
|
* ext/win32ole/tests/testOLETYPELIB.rb: correct expected message.
|
||||||
|
|
||||||
Fri Apr 15 22:04:07 2005 Masaki Suketa <masaki.suketa@nifty.ne.jp>
|
Fri Apr 15 22:04:07 2005 Masaki Suketa <masaki.suketa@nifty.ne.jp>
|
||||||
|
|
||||||
* ext/win32ole/win32ole.c(ole_invoke): retry after converting Qnil
|
* ext/win32ole/win32ole.c(ole_invoke): retry after converting Qnil
|
||||||
|
|
|
@ -21,7 +21,7 @@ class TestOLETYPELIB < Test::Unit::TestCase
|
||||||
msg = $!.to_s
|
msg = $!.to_s
|
||||||
exception_occured = true
|
exception_occured = true
|
||||||
end
|
end
|
||||||
assert_equal("Not found type library `NON EXIST TYPELIB`", msg)
|
assert_equal("not found type library `NON EXIST TYPELIB`", msg)
|
||||||
assert(exception_occured)
|
assert(exception_occured)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ class TestWin32OLE < RUNIT::TestCase
|
||||||
exc = assert_exception(WIN32OLERuntimeError) {
|
exc = assert_exception(WIN32OLERuntimeError) {
|
||||||
WIN32OLE.new("{000}")
|
WIN32OLE.new("{000}")
|
||||||
}
|
}
|
||||||
assert_match(/Unknown OLE server: `\{000\}'/, exc.message)
|
assert_match(/unknown OLE server: `\{000\}'/, exc.message)
|
||||||
end
|
end
|
||||||
def test_s_connect
|
def test_s_connect
|
||||||
excel2 = WIN32OLE.connect('Excel.Application')
|
excel2 = WIN32OLE.connect('Excel.Application')
|
||||||
|
@ -96,6 +96,22 @@ class TestWin32OLE < RUNIT::TestCase
|
||||||
assert_equal(65001, WIN32OLE::CP_UTF8)
|
assert_equal(65001, WIN32OLE::CP_UTF8)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_s_codepage_changed
|
||||||
|
book = @excel.workbooks.add
|
||||||
|
sheet = book.worksheets(1)
|
||||||
|
begin
|
||||||
|
WIN32OLE.codepage = WIN32OLE::CP_UTF8
|
||||||
|
sheet.range("A1").value = [0x3042].pack("U*")
|
||||||
|
val = sheet.range("A1").value
|
||||||
|
assert_equal("\343\201\202", val)
|
||||||
|
WIN32OLE.codepage = WIN32OLE::CP_ACP
|
||||||
|
val = sheet.range("A1").value
|
||||||
|
assert_equal("\202\240", val)
|
||||||
|
ensure
|
||||||
|
book.saved = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def test_get_win32ole_object
|
def test_get_win32ole_object
|
||||||
workbooks = @excel.Workbooks;
|
workbooks = @excel.Workbooks;
|
||||||
assert_instance_of(WIN32OLE, workbooks)
|
assert_instance_of(WIN32OLE, workbooks)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue