diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2021-02-28 14:44:22 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2021-02-28 14:44:22 +0000 |
commit | e31ab1a240add146943eb0492d9929c6c92174b6 (patch) | |
tree | 7d68e0af298e25aed364b9b1215e26ab4cd8efe8 /test | |
parent | aa19f11dbdbaf06afc1a7f053d9bcd26e718ffb3 (diff) |
merge revision(s) 8b6e2685: [Backport #16649]
Fixed symbol misused as ID
rb_funcallv_public and rb_respond_to require an ID, not a
Symbol. [Bug #16649]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_6@67901 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_transcode.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_transcode.rb b/test/ruby/test_transcode.rb index 44d238ffd2..7f81cbf424 100644 --- a/test/ruby/test_transcode.rb +++ b/test/ruby/test_transcode.rb @@ -2161,6 +2161,14 @@ class TestTranscode < Test::Unit::TestCase assert_equal("U+3042", "\u{3042}".encode("US-ASCII", fallback: fallback.method(:escape))) end + def test_fallback_aref + fallback = Object.new + def fallback.[](x) + "U+%.4X" % x.unpack("U") + end + assert_equal("U+3042", "\u{3042}".encode("US-ASCII", fallback: fallback)) + end + bug8940 = '[ruby-core:57318] [Bug #8940]' %w[UTF-32 UTF-16].each do |enc| define_method("test_pseudo_encoding_inspect(#{enc})") do |