File 1791-shell_docs_test-Clean-the-stacktrace-from-all-line-n.patch of Package erlang
From 4079a48d0e6d5390bb81688a2b3f743a0dfa826e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= <bjorn@erlang.org>
Date: Sun, 23 Mar 2025 05:50:53 +0100
Subject: [PATCH 1/2] shell_docs_test: Clean the stacktrace from all line
numbers
---
lib/stdlib/src/shell_docs_test.erl | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/lib/stdlib/src/shell_docs_test.erl b/lib/stdlib/src/shell_docs_test.erl
index ada215ebe6..65d61ab715 100644
--- a/lib/stdlib/src/shell_docs_test.erl
+++ b/lib/stdlib/src/shell_docs_test.erl
@@ -384,9 +384,8 @@ rewrite_tokens([H | T]) ->
rewrite_tokens([]) ->
[].
-format_exception(Class, Reason, [{M,F,A,Info0},Item|_]) ->
- Info = lists:keydelete(line, 1, Info0),
- Stacktrace = [{M,F,A,Info},Item],
+format_exception(Class, Reason, [Top,Next|_]) ->
+ Stacktrace = [clean_stacktrace_item(Item) || Item <- [Top,Next]],
Tag = "** ",
I = iolist_size(Tag) + 1,
PF = fun pp/2,
@@ -395,6 +394,10 @@ format_exception(Class, Reason, [{M,F,A,Info0},Item|_]) ->
Str = erl_error:format_exception(I, Class, Reason, Stacktrace, SF, PF, Enc),
Tag ++ string:trim(lists:flatten(Str), trailing).
+clean_stacktrace_item({M,F,A,Info0}) ->
+ Info = lists:keydelete(line, 1, Info0),
+ {M,F,A,Info}.
+
pp(V, I) ->
D = 30,
io_lib_pretty:print(V, [{column, I}, {line_length, 120},
--
2.51.0