From 9226f3ac80ab9e74f4e6214781bf694d5ca37927 Mon Sep 17 00:00:00 2001 From: Alexander Bulancov <6594487+trinistr@users.noreply.github.com> Date: Sat, 31 Jan 2026 19:47:15 +0300 Subject: [PATCH] [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] --- command_line/error_message_spec.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/command_line/error_message_spec.rb b/command_line/error_message_spec.rb index 02150f30ce..8d696e8bb3 100644 --- a/command_line/error_message_spec.rb +++ b/command_line/error_message_spec.rb @@ -8,4 +8,9 @@ out = ruby_exe("end #syntax error", args: "2> #{File::NULL}", exit_status: 1) out.chomp.should.empty? end + + it "is not modified with extra escaping of control characters and backslashes" do + out = ruby_exe('raise "\e[31mRed\x1b[0m error\\\message"', args: "2>&1", exit_status: 1) + out.chomp.should include("\e[31mRed\e[0m error\\message") + end end