From 8fb23913ad3f9fadafcf42b719d4b6afef0ef880 Mon Sep 17 00:00:00 2001 From: akr Date: Sun, 23 Dec 2007 16:10:36 +0000 Subject: [PATCH] more IO m17n tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_io_m17n.rb | 126 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 122 insertions(+), 4 deletions(-) diff --git a/test/ruby/test_io_m17n.rb b/test/ruby/test_io_m17n.rb index 43f3c3ce01..e6ba9913a9 100644 --- a/test/ruby/test_io_m17n.rb +++ b/test/ruby/test_io_m17n.rb @@ -1,7 +1,7 @@ require 'test/unit' require 'tmpdir' -class TestIOM17N < Test::Unit::TestCase +class TestIO_M17N < Test::Unit::TestCase def with_tmpdir Dir.mktmpdir {|dir| Dir.chdir dir @@ -9,14 +9,132 @@ class TestIOM17N < Test::Unit::TestCase } end - def test_conversion + def generate_file(path, content) + open(path, "wb") {|f| f.write content } + end + + def encdump(str) + "#{str.dump}.force_encoding(#{str.encoding.name.dump})" + end + + def assert_str_equal(expected, actual, message=nil) + full_message = build_message(message, <