From d4b866914bc76958f956eeb36c441968440668ee Mon Sep 17 00:00:00 2001 From: suke Date: Sat, 3 Feb 2007 05:41:03 +0000 Subject: * ext/win32ole/win32ole.c (ole_val2olevariantdata, ole_val2variant): fix the bug of WIN32OLE_VARIANT.new when variant type is VT_ARRAY. * ext/win32ole/sample/excel1.rb: rewrite using WIN32OLE_VARIANT. * test/win32ole/test_win32ole.rb: add some test. * test/win32ole/test_win32ole_variant.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11624 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/win32ole/test_win32ole.rb | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'test/win32ole/test_win32ole.rb') diff --git a/test/win32ole/test_win32ole.rb b/test/win32ole/test_win32ole.rb index bcfd63f4ea..d7a9b368a1 100644 --- a/test/win32ole/test_win32ole.rb +++ b/test/win32ole/test_win32ole.rb @@ -119,6 +119,19 @@ if defined?(WIN32OLE) assert_equal("BAR", @dict1["foo"]) end + def test_invoke_with_array + @dict1.add("ary1", [1,2,3]) + assert_equal([1,2,3], @dict1["ary1"]) + + @dict1.add("ary2", [[1,2,"a"], [3,4,"b"]]) + assert_equal([[1,2,"a"], [3,4,"b"]], @dict1["ary2"]) + + @dict1.add("ary3", [[[1]]]) + assert_equal([[[1]]], @dict1["ary3"]) + + @dict1.add("ary4", [[[1], [2], [3]], [[4], [5], [6]]]) + assert_equal([[[1],[2], [3]], [[4], [5], [6]]], @dict1["ary4"]) + end end class TestWin32OLE < Test::Unit::TestCase @@ -146,9 +159,10 @@ if defined?(WIN32OLE) assert_match(/unknown OLE server: `\{000\}'/, exc.message) end - # test_s_connect was moved to test_word.rb - # def test_s_connect - # end + def test_s_connect + obj = WIN32OLE.connect("winmgmts:") + assert_instance_of(WIN32OLE, obj) + end def test_invoke_accept_symbol_hash_key fso = WIN32OLE.new('Scripting.FileSystemObject') -- cgit v1.2.3