From 4d650bc25737a4d2c0dcc9d4c845688cb5dc85ce Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sat, 22 Jun 2019 09:29:33 +0900 Subject: [PATCH] Fix over-expansion * test/lib/minitest/unit.rb (MiniTest::Assertions#mu_pp_for_diff): do not expand escaped backslash followed by 'n'. --- test/lib/minitest/unit.rb | 2 +- test/minitest/test_minitest_unit.rb | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/test/lib/minitest/unit.rb b/test/lib/minitest/unit.rb index 25fd15d0937b8d..6ba1c707e6eb20 100644 --- a/test/lib/minitest/unit.rb +++ b/test/lib/minitest/unit.rb @@ -179,7 +179,7 @@ def mu_pp obj # uses mu_pp to do the first pass and then cleans it up. def mu_pp_for_diff obj - mu_pp(obj).gsub(/\\n/, "\n").gsub(/:0x[a-fA-F0-9]{4,}/m, ':0xXXXXXX') + mu_pp(obj).gsub(/(?