Skip to content

Commit 210bed5

Browse files
committed
Spec for #inspect on broken UTF-8 sequences
1 parent a97adb1 commit 210bed5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

spec/ruby/core/string/inspect_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,10 @@
317317
0.chr.inspect.should == '"\\x00"'
318318
end
319319

320+
it "uses \\x notation for broken UTF-8 sequences" do
321+
"\xF0\x9F".inspect.should == '"\\xF0\\x9F"'
322+
end
323+
320324
describe "when default external is UTF-8" do
321325
before :each do
322326
@extenc, Encoding.default_external = Encoding.default_external, Encoding::UTF_8

0 commit comments

Comments
 (0)