diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-02-25 03:28:00 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-02-25 03:28:00 +0000 |
commit | 5e980638541fe0dd62c19ee12cce5861f5e00409 (patch) | |
tree | 5fc8c4edd7977b039cf89c8bfa05f33d13f9b01e /test | |
parent | 34908ccb4746b447fc5b61bdf9a93f7086cbe1f8 (diff) | |
download | ruby-5e980638541fe0dd62c19ee12cce5861f5e00409.tar.gz ruby-5e980638541fe0dd62c19ee12cce5861f5e00409.tar.xz ruby-5e980638541fe0dd62c19ee12cce5861f5e00409.zip |
* string.c (rb_str_force_encoding): should clear coderange at changing
encoding. [ruby-core:22437]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22611 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_m17n.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/test/ruby/test_m17n.rb b/test/ruby/test_m17n.rb index 4b7543f3e..2f435f645 100644 --- a/test/ruby/test_m17n.rb +++ b/test/ruby/test_m17n.rb @@ -1107,10 +1107,10 @@ class TestM17N < Test::Unit::TestCase end def test_symbol_op - ops = %w[ + ops = %w" .. ... + - +(binary) -(binary) * / % ** +@ -@ | ^ & ! <=> > >= < <= == === != =~ !~ ~ ! [] []= << >> :: ` - ] #` + " ops.each do |op| assert_equal(Encoding::US_ASCII, op.intern.encoding, "[ruby-dev:33449]") end @@ -1164,7 +1164,7 @@ class TestM17N < Test::Unit::TestCase end def test_bignum_to_s - assert_equal(Encoding::US_ASCII, (1<<129).to_s.encoding) + assert_equal(Encoding::US_ASCII, (1 << 129).to_s.encoding) end def test_array_to_s @@ -1306,6 +1306,10 @@ class TestM17N < Test::Unit::TestCase def test_force_encoding assert(("".center(1, "\x80".force_encoding("utf-8")); true), "moved from btest/knownbug, [ruby-dev:33807]") + a = "".force_encoding("ascii-8bit") << 0xC3 << 0xB6 + assert_equal(1, a.force_encoding("utf-8").size, '[ruby-core:22437]') + b = "".force_encoding("ascii-8bit") << 0xC3.chr << 0xB6.chr + assert_equal(1, b.force_encoding("utf-8").size, '[ruby-core:22437]') end def test_combchar_codepoint |