Fix for other than UTF-8 environments

This commit is contained in:
Nobuyoshi Nakada 2025-10-29 14:21:51 +09:00
parent 103e91a063
commit f8d7482d02
No known key found for this signature in database
GPG Key ID: 3582D74E1FEE4465
Notes: git 2025-10-29 05:59:44 +00:00

View File

@ -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