summaryrefslogtreecommitdiff
path: root/test/ruby/test_econv.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-31 09:08:31 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-31 09:08:31 +0000
commit69610b07c304e6ef61c108afaa525fa84cd80451 (patch)
treedbc9801ad6b54bab6477aaaff9682ae36c445fcc /test/ruby/test_econv.rb
parent6e37ddcfbddd5053655d38bf8dc827d8c2ea3379 (diff)
* transcode.c (transcode.c): set source_encoding and
destination_encoding as encoding object. (ecerr_source_encoding): new method. (ecerr_destination_encoding): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18993 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_econv.rb')
-rw-r--r--test/ruby/test_econv.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_econv.rb b/test/ruby/test_econv.rb
index c18d7a8e65..3e2814bff0 100644
--- a/test/ruby/test_econv.rb
+++ b/test/ruby/test_econv.rb
@@ -457,6 +457,8 @@ class TestEncodingConverter < Test::Unit::TestCase
}
assert_equal("EUC-JP", err.source_encoding_name)
assert_equal("UTF-8", err.destination_encoding_name)
+ assert_equal(Encoding::EUC_JP, err.source_encoding)
+ assert_equal(Encoding::UTF_8, err.destination_encoding)
assert_equal("\xA4".force_encoding("ASCII-8BIT"), err.error_bytes)
assert_equal("d", err.readagain_bytes)
assert_equal(false, err.incomplete_input?)
@@ -468,6 +470,8 @@ class TestEncodingConverter < Test::Unit::TestCase
}
assert_equal("EUC-JP", err.source_encoding_name)
assert_equal("UTF-8", err.destination_encoding_name)
+ assert_equal(Encoding::EUC_JP, err.source_encoding)
+ assert_equal(Encoding::UTF_8, err.destination_encoding)
assert_equal("\xA4".force_encoding("ASCII-8BIT"), err.error_bytes)
assert_equal(nil, err.readagain_bytes)
assert_equal(true, err.incomplete_input?)
@@ -479,6 +483,8 @@ class TestEncodingConverter < Test::Unit::TestCase
}
assert_equal("UTF-8", err.source_encoding_name)
assert_equal("ISO-8859-1", err.destination_encoding_name)
+ assert_equal(Encoding::UTF_8, err.source_encoding)
+ assert_equal(Encoding::ISO_8859_1, err.destination_encoding)
assert_equal("\u{3042}", err.error_char)
end