diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-12-20 13:22:48 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-12-20 13:22:48 +0000 |
commit | 0d0636d22ce7bd4729d749ca36cf2cde5175d815 (patch) | |
tree | 083083af8310832b9a0cf94c004682751bfe18dd /test | |
parent | 7decd09b6265031144cebd5279061c05447e1c8c (diff) |
merges r29848 and r29852 from trunk into ruby_1_9_2.
--
* string.c (rb_str_concat): set ENC_CODERANGE_VALID when the
receiver is 7BIT and the argument is non ASCII.
--
Fix r29848's test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@30261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_m17n.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_m17n.rb b/test/ruby/test_m17n.rb index 3682d09898..3a71bd9bf0 100644 --- a/test/ruby/test_m17n.rb +++ b/test/ruby/test_m17n.rb @@ -1093,6 +1093,12 @@ class TestM17N < Test::Unit::TestCase assert_equal(a, s.each_char.to_a, "[ruby-dev:33211] #{encdump s}.each_char.to_a") end + def test_str_concat + assert_equal(1, "".concat(0xA2).size) + assert_equal("A\x84\x31\xA4\x39".force_encoding("GB18030"), + "A".force_encoding("GB18030") << 0x8431A439) + end + def test_regexp_match assert_equal([0,0], //.match("\xa1\xa1".force_encoding("euc-jp"),-1).offset(0)) assert_equal(0, // =~ :a) |