File 0190-CT-Keep-badmatch-EXIT-messages-single-line.patch of Package erlang
From fa67ba4f880d81ab6ab11bb3a574af0da9f2bcf8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= <essen@ninenines.eu>
Date: Mon, 13 Oct 2025 12:34:13 +0200
Subject: [PATCH 2/2] CT: Keep badmatch/'EXIT' messages single line
Since we restrict them to 50 characters there's no real
reason not to print them on a single line.
Before:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Error detected: {'EXIT',{badmatch,[{watchdog,<0.1038.0>},
{ref,...}
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
After:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Error detected: {'EXIT',{badmatch,[{watchdog,<0.251.0>},{ref,http_compress...}
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
---
lib/common_test/src/ct_framework.erl | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/common_test/src/ct_framework.erl b/lib/common_test/src/ct_framework.erl
index 1c69d31506..1a131db52b 100644
--- a/lib/common_test/src/ct_framework.erl
+++ b/lib/common_test/src/ct_framework.erl
@@ -941,7 +941,7 @@ error_notification(Mod,Func,_Args,{Error,Loc}) ->
end,
ErrorStr = case ErrorSpec of
{badmatch,Descr} ->
- Descr1 = io_lib:format("~tP",[Descr,10]),
+ Descr1 = io_lib:format("~0tP",[Descr,10]),
DescrLength = string:length(Descr1),
if DescrLength > 50 ->
Descr2 = string:slice(Descr1,0,50),
@@ -950,7 +950,7 @@ error_notification(Mod,Func,_Args,{Error,Loc}) ->
io_lib:format("{badmatch,~ts}",[Descr1])
end;
{'EXIT',Descr} ->
- Descr1 = io_lib:format("~tP",[Descr,10]),
+ Descr1 = io_lib:format("~0tP",[Descr,10]),
DescrLength = string:length(Descr1),
if DescrLength > 50 ->
Descr2 = string:slice(Descr1,0,50),
--
2.51.0