diff options
Diffstat (limited to 'spec/ruby/core/string/inspect_spec.rb')
-rw-r--r-- | spec/ruby/core/string/inspect_spec.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/ruby/core/string/inspect_spec.rb b/spec/ruby/core/string/inspect_spec.rb index 9818796c83..98b5b32b61 100644 --- a/spec/ruby/core/string/inspect_spec.rb +++ b/spec/ruby/core/string/inspect_spec.rb @@ -502,5 +502,11 @@ describe "String#inspect" do "\u{3042}".encode("EUC-JP").inspect.should == '"\\x{A4A2}"' end end + + describe "and the string has both ASCII-compatible and ASCII-incompatible chars" do + it "returns a string with the non-ASCII characters replaced by \\u notation" do + "hello привет".encode("utf-16le").inspect.should == '"hello \\u043F\\u0440\\u0438\\u0432\\u0435\\u0442"' + end + end end end |