mirror of
https://github.com/ruby/ruby.git
synced 2026-01-26 20:19:19 +00:00
Fix for other than UTF-8 environments
This commit is contained in:
parent
103e91a063
commit
f8d7482d02
Notes:
git
2025-10-29 05:59:44 +00:00
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user