Properly fix line break in strings.
This commit is contained in:
+1
-1
@@ -169,7 +169,7 @@ module String
|
||||
def inspect
|
||||
list = Erlang.binary_to_list(self)
|
||||
if Erlang.io_lib.printable_unicode_list(list)
|
||||
<<$\", gsub(~r{("|#|\n|\r)}, "\\\\\\1")|binary, $\">>
|
||||
<<$\", gsub(~r{("|#)}, "\\\\\\1").gsub(~r{\n}, "\\\\n")|binary, $\">>
|
||||
else
|
||||
Erlang.io_lib.format($"~w", [self]).to_bin
|
||||
end
|
||||
|
||||
@@ -97,7 +97,7 @@ three
|
||||
"<<1,2,3>>" = <<1,2,3>>.inspect
|
||||
"\"f\\\"o\\\"o\"" = "f\"o\"o".inspect
|
||||
"\"f\\\#o\"" = "f#o".inspect
|
||||
"\"f\\\no\"" = "f\no".inspect
|
||||
"\"f\\no\"" = "f\no".inspect
|
||||
end
|
||||
|
||||
def to_atom_test
|
||||
|
||||
Reference in New Issue
Block a user