summaryrefslogtreecommitdiff
path: root/test/ruby/test_transcode.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-02-24 15:33:50 +0900
committerNARUSE, Yui <naruse@airemix.jp>2020-03-14 16:00:46 +0900
commitfa48a26d886d86469a0075d91d152252e9fc0c8c (patch)
treec4aa8e9c6587fefd1bd7be5bc5ed57879230b142 /test/ruby/test_transcode.rb
parent3e7e1b965b06f3c843972d7e2f6e3d040374d67f (diff)
Fixed symbol misused as ID
`rb_funcallv_public` and `rb_respond_to` require an `ID`, not a `Symbol`. [Bug #16649] (cherry picked from commit 8b6e2685a4b7c7de905f7ed60c02ef85e0724754)
Diffstat (limited to 'test/ruby/test_transcode.rb')
-rw-r--r--test/ruby/test_transcode.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_transcode.rb b/test/ruby/test_transcode.rb
index f405877dd5..1f4c623acb 100644
--- a/test/ruby/test_transcode.rb
+++ b/test/ruby/test_transcode.rb
@@ -2183,6 +2183,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