Skip to content

Commit 9882cbd

Browse files
nobuheadius
authored andcommitted
Fix for other than UTF-8 environments
1 parent 7076466 commit 9882cbd

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

core/symbol/inspect_spec.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,14 @@
9797
:" foo" => ":\" foo\"",
9898
:" " => ":\" \"",
9999

100-
:"ê" => ":ê",
101-
:"测" => ":测",
102-
:"🦊" => ":🦊",
100+
:"ê" => [":ê", ":\"\\u00EA\""],
101+
:"测" => [":测", ":\"\\u6D4B\""],
102+
:"🦊" => [":🦊", ":\"\\u{1F98A}\""],
103103
}
104104

105+
expected_by_encoding = Encoding::default_external == Encoding::UTF_8 ? 0 : 1
105106
symbols.each do |input, expected|
107+
expected = expected[expected_by_encoding] if expected.is_a?(Array)
106108
it "returns self as a symbol literal for #{expected}" do
107109
input.inspect.should == expected
108110
end

0 commit comments

Comments
 (0)