diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-09 02:29:24 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-09 02:29:24 +0000 |
commit | 54c146d2c3d8a9a5e3d4bbd8b5fd61e17ad45819 (patch) | |
tree | d2b105360fbe0b0ee6f508772d76510471e3f63e /test | |
parent | 221e6de720042585265cb38c05701663829ac40d (diff) |
* string.c (tr_trans): get rid of segfaults when has mulitbytes but
source sets have no mulitbytes.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14148 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 f923173e5a..542c3d2b00 100644 --- a/test/ruby/test_m17n.rb +++ b/test/ruby/test_m17n.rb @@ -483,4 +483,10 @@ class TestM17N < Test::Unit::TestCase assert_raise(SyntaxError) { eval(s(%{/\\u{6666}#{}\\xc2\\xa0/})) } assert_nothing_raised { eval(u(%{/\\u{6666}#{}\\xc2\\xa0/})) } end + + def test_tr + s = "\x81\x41".force_encoding("shift_jis") + assert_equal(s.tr("A", "B"), s) + assert_equal(s.tr_s("A", "B"), s) + end end |