diff options
author | nagachika <nagachika@ruby-lang.org> | 2022-09-25 21:24:30 +0900 |
---|---|---|
committer | nagachika <nagachika@ruby-lang.org> | 2022-09-25 21:24:30 +0900 |
commit | e46532feafadef252682794c941180df72483c19 (patch) | |
tree | 6db8b46f28b7c72e784868e8b1b07c61a81c30f8 /test | |
parent | d1b36c827036765ab68c88ab4315a26a220d5f06 (diff) |
merge revision(s) cf7d07570f50ef9c16007019afcff11ba6500d70: [Backport #18938]
Dump non-ASCII char as unsigned
Non-ASCII code may be negative on platforms plain char is signed.
---
ext/objspace/objspace_dump.c | 2 +-
test/objspace/test_objspace.rb | 15 +++++++++++++++
2 files changed, 16 insertions(+), 1 deletion(-)
Diffstat (limited to 'test')
-rw-r--r-- | test/objspace/test_objspace.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/objspace/test_objspace.rb b/test/objspace/test_objspace.rb index a1954d56a9..bdc9c8c3d7 100644 --- a/test/objspace/test_objspace.rb +++ b/test/objspace/test_objspace.rb @@ -632,4 +632,19 @@ class TestObjSpace < Test::Unit::TestCase assert_equal '42', out[2] end end + + def test_utf8_method_names + name = "utf8_❨╯°□°❩╯︵┻━┻" + obj = ObjectSpace.trace_object_allocations do + __send__(name) + end + dump = ObjectSpace.dump(obj) + assert_equal name, JSON.parse(dump)["method"], dump + end + + private + + def utf8_❨╯°□°❩╯︵┻━┻ + "1#{2}" + end end |