diff options
| author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-01-23 09:19:10 +0000 |
|---|---|---|
| committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-01-23 09:19:10 +0000 |
| commit | 3c0ebab6f1598377fc652ec2ebe2411d19bd1bc8 (patch) | |
| tree | ae8d848eac216df559209b93f5a3b51d22b9e54f /test | |
| parent | 6c0276184917d810d14dd97bd8cf16aed93e4bc7 (diff) | |
merge revision(s) r34350:
* encoding.c (rb_enc_compatible): fix segv on symbols.
[ruby-core:42204] [Bug #5921]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
| -rw-r--r-- | test/ruby/test_encoding.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_encoding.rb b/test/ruby/test_encoding.rb index eaad03d302..e0a27ef6b6 100644 --- a/test/ruby/test_encoding.rb +++ b/test/ruby/test_encoding.rb @@ -101,4 +101,10 @@ class TestEncoding < Test::Unit::TestCase bug5279 = '[ruby-dev:44469]' assert_ruby_status([], '$SAFE=3; "a".encode("utf-16be")', bug5279) end + + def test_compatible_p + ua = "abc".force_encoding(Encoding::UTF_8) + assert_equal(Encoding::UTF_8, Encoding.compatible?(ua, :abc)) + assert_equal(nil, Encoding.compatible?(ua, 1)) + end end |
