diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-14 17:37:35 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-14 17:37:35 +0000 |
commit | 2f67b43aeca4530842db1324983a0e7a563917cc (patch) | |
tree | 3c7e0a3937b2e778057ae7c0e7be99089112e86f /test | |
parent | ca36233e55625b6653e68e27e37cd9e30d11b491 (diff) | |
download | ruby-2f67b43aeca4530842db1324983a0e7a563917cc.tar.gz |
* transcode.c (str_encode): returns duplicated string if nothing
changed. [ruby-core:18578]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19349 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_transcode.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_transcode.rb b/test/ruby/test_transcode.rb index 5abeed88ee..8770328bc1 100644 --- a/test/ruby/test_transcode.rb +++ b/test/ruby/test_transcode.rb @@ -582,4 +582,10 @@ class TestTranscode < Test::Unit::TestCase assert_raise(Encoding::ConversionUndefined) { "\u203E".encode("CP51932") } end + def test_nothing_changed + a = "James".force_encoding("US-ASCII") + b = a.encode("Shift_JIS") + assert_equal(Encoding::US_ASCII, a.encoding) + assert_equal(Encoding::Shift_JIS, b.encoding) + end end |