Skip to content

Commit 2ca2938

Browse files
committed
Add spec for Hash#inspect with multibyte keys
1 parent 8d43afb commit 2ca2938

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

spec/ruby/core/hash/shared/to_s.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@
8585
{ true => false }.to_s.should == expected
8686
end
8787

88+
it "leaves printable multi-byte symbolic keys unescaped" do
89+
{"\u3042": 1}.inspect.should == "{あ: 1}"
90+
end
91+
8892
ruby_version_is "3.4" do
8993
it "adds quotes to symbol keys that are not valid symbol literals" do
9094
{ "needs-quotes": 1 }.send(@method).should == '{"needs-quotes": 1}'

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy