diff options
| author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2025-10-29 14:21:51 +0900 |
|---|---|---|
| committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2025-10-29 14:26:39 +0900 |
| commit | f8d7482d0269ab287a0254f33e53f55f4d4bf343 (patch) | |
| tree | f4fda22dff06bd21fb2018d91ce65523ae95f7b7 /spec/ruby | |
| parent | 103e91a06376c98e8d1cd876dc7cdb8cc6e087ef (diff) | |
Fix for other than UTF-8 environments
Diffstat (limited to 'spec/ruby')
| -rw-r--r-- | spec/ruby/core/symbol/inspect_spec.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/spec/ruby/core/symbol/inspect_spec.rb b/spec/ruby/core/symbol/inspect_spec.rb index 5af03a6484..df4566c48e 100644 --- a/spec/ruby/core/symbol/inspect_spec.rb +++ b/spec/ruby/core/symbol/inspect_spec.rb @@ -97,12 +97,14 @@ describe "Symbol#inspect" do :" foo" => ":\" foo\"", :" " => ":\" \"", - :"ê" => ":ê", - :"测" => ":测", - :"🦊" => ":🦊", + :"ê" => [":ê", ":\"\\u00EA\""], + :"测" => [":测", ":\"\\u6D4B\""], + :"🦊" => [":🦊", ":\"\\u{1F98A}\""], } + expected_by_encoding = Encoding::default_external == Encoding::UTF_8 ? 0 : 1 symbols.each do |input, expected| + expected = expected[expected_by_encoding] if expected.is_a?(Array) it "returns self as a symbol literal for #{expected}" do input.inspect.should == expected end |
