From 453890a97296d9e342384832bffad5af031d0bca Mon Sep 17 00:00:00 2001 From: akr Date: Sun, 15 Nov 2009 17:11:54 +0000 Subject: tests refined. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_dir_m17n.rb | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) (limited to 'test/ruby/test_dir_m17n.rb') diff --git a/test/ruby/test_dir_m17n.rb b/test/ruby/test_dir_m17n.rb index 852f093006..a6c9fcadad 100644 --- a/test/ruby/test_dir_m17n.rb +++ b/test/ruby/test_dir_m17n.rb @@ -13,34 +13,50 @@ class TestDir_M17N < Test::Unit::TestCase def test_filename_bytes_euc_jp with_tmpdir {|d| - assert_in_out(%w[-EEUC-JP], <<-'EOS', %w[true], nil, :chdir=>d) + assert_ruby_status(%w[-EEUC-JP], <<-'EOS', nil, :chdir=>d) filename = "\xA4\xA2".force_encoding("euc-jp") File.open(filename, "w") {} ents = Dir.entries(".") ents.each {|e| e.force_encoding("ASCII-8BIT") } - p ents.include?(filename.force_encoding("ASCII-8BIT")) + exit ents.include?(filename.force_encoding("ASCII-8BIT")) EOS } end def test_filename_euc_jp with_tmpdir {|d| - assert_in_out(%w[-EEUC-JP], <<-'EOS', %w[true], nil, :chdir=>d) + assert_ruby_status(%w[-EEUC-JP], <<-'EOS', nil, :chdir=>d) filename = "\xA4\xA2".force_encoding("euc-jp") File.open(filename, "w") {} ents = Dir.entries(".") - p ents.include?(filename) + exit ents.include?(filename) EOS } end def test_filename_utf_8 with_tmpdir {|d| - assert_in_out(%w[-EUTF-8], <<-'EOS', %w[true], nil, :chdir=>d) + assert_ruby_status(%w[-EUTF-8], <<-'EOS', nil, :chdir=>d) filename = "\u3042".force_encoding("utf-8") File.open(filename, "w") {} ents = Dir.entries(".") - p ents.include?(filename) + exit ents.include?(filename) + EOS + } + end + + def test_filename_ext_euc_jp_and_int_utf_8 + with_tmpdir {|d| + assert_ruby_status(%w[-EEUC-JP], <<-'EOS', nil, :chdir=>d) + filename = "\xA4\xA2".force_encoding("euc-jp") + File.open(filename, "w") {} + ents = Dir.entries(".") + exit ents.include?(filename) + EOS + assert_ruby_status(%w[-EEUC-JP:UTF-8], <<-'EOS', nil, :chdir=>d) + filename = "\u3042".force_encoding("utf-8") + ents = Dir.entries(".") + exit ents.include?(filename) EOS } end -- cgit v1.2.3