Skip to content

Commit 011609c

Browse files
trinistreregon
authored andcommitted
[Ruby 3.2] Add test for no extra escaping in error messages
Ruby no longer escapes control characters and backslashes in an error message. [Feature #18367]
1 parent 5459731 commit 011609c

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

command_line/error_message_spec.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,9 @@
88
out = ruby_exe("end #syntax error", args: "2> #{File::NULL}", exit_status: 1)
99
out.chomp.should.empty?
1010
end
11+
12+
it "is not modified with extra escaping of control characters and backslashes" do
13+
out = ruby_exe('raise "\e[31mRed\e[0m error\\\\message"', args: "2>&1", exit_status: 1)
14+
out.chomp.should include("\e[31mRed\e[0m error\\message")
15+
end
1116
end

0 commit comments

Comments
 (0)