File 0439-common_test-order-maps-by-key-when-printing-anywhere.patch of Package erlang

From f35c2a9d2b1956a9acfc7680b1fcc3fb11e767bb Mon Sep 17 00:00:00 2001
From: Konrad Pietrzak <konrad@erlang.org>
Date: Thu, 22 May 2025 11:58:26 +0200
Subject: [PATCH] common_test: order maps by key when printing anywhere

---
 lib/common_test/src/ct_framework.erl     |  2 +-
 lib/common_test/src/test_server_ctrl.erl | 14 +++++++-------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/lib/common_test/src/ct_framework.erl b/lib/common_test/src/ct_framework.erl
index c2ca7a1b82..242fd3ce1e 100644
--- a/lib/common_test/src/ct_framework.erl
+++ b/lib/common_test/src/ct_framework.erl
@@ -952,7 +952,7 @@ error_notification(Mod,Func,_Args,{Error,Loc}) ->
 		 {test_case_failed,Reason} ->
 		     case (catch io_lib:format("{test_case_failed,~ts}", [Reason])) of
 			 {'EXIT',_} ->
-			     io_lib:format("{test_case_failed,~tp}", [Reason]);
+			     io_lib:format("{test_case_failed,~tkp}", [Reason]);
 			 Result -> Result
 		     end;
 		 Other ->
diff --git a/lib/common_test/src/test_server_ctrl.erl b/lib/common_test/src/test_server_ctrl.erl
index 411928c12b..6a24117904 100644
--- a/lib/common_test/src/test_server_ctrl.erl
+++ b/lib/common_test/src/test_server_ctrl.erl
@@ -4051,7 +4051,7 @@ progress(skip, CaseNum, Mod, Func, GrName, Loc, Reason, T,
 		     fun() -> {?auto_skip_color,auto_skip,auto_skipped} end,
 		     fun() -> {?user_skip_color,skip,skipped} end),
     Time = if is_number(T) -> float(T); true -> 0.0 end,
-    print(major, "=result        ~w: ~tp", [ReportTag,Reason1]),
+    print(major, "=result        ~w: ~tkp", [ReportTag,Reason1]),
     print(major, "=elapsed       ~.6fs", [Time]),
     print(1, "*** SKIPPED ~ts ***",
 	  [get_info_str(Mod,Func, CaseNum, get(test_server_cases))]),
@@ -4085,7 +4085,7 @@ progress(skip, CaseNum, Mod, Func, GrName, Loc, Reason, T,
 progress(failed, CaseNum, Mod, Func, GrName, Loc, timetrap_timeout, T,
 	 Comment0, {St0,St1}) ->
     Time = if is_number(T) -> float(T); true -> 0.0 end,
-    print(major, "=result        failed: timeout, ~tp", [Loc]),
+    print(major, "=result        failed: timeout, ~tkp", [Loc]),
     print(major, "=elapsed       ~.6fs", [Time]),
     print(1, "*** FAILED ~ts ***",
 	  [get_info_str(Mod,Func, CaseNum, get(test_server_cases))]),
@@ -4113,7 +4113,7 @@ progress(failed, CaseNum, Mod, Func, GrName, Loc, timetrap_timeout, T,
 progress(failed, CaseNum, Mod, Func, GrName, Loc, {testcase_aborted,Reason}, T,
 	 Comment0, {St0,St1}) ->
     Time = if is_number(T) -> float(T); true -> 0.0 end,
-    print(major, "=result        failed: testcase_aborted, ~tp", [Loc]),
+    print(major, "=result        failed: testcase_aborted, ~tkp", [Loc]),
     print(major, "=elapsed       ~.6fs", [Time]),
     print(1, "*** FAILED ~ts ***",
 	  [get_info_str(Mod,Func, CaseNum, get(test_server_cases))]),
@@ -4144,7 +4144,7 @@ progress(failed, CaseNum, Mod, Func, GrName, Loc, {testcase_aborted,Reason}, T,
 progress(failed, CaseNum, Mod, Func, GrName, unknown, Reason, T,
 	 Comment0, {St0,St1}) ->
     Time = if is_number(T) -> float(T); true -> 0.0 end,
-    print(major, "=result        failed: ~tp, ~w", [Reason,unknown_location]),
+    print(major, "=result        failed: ~tkp, ~w", [Reason,unknown_location]),
     print(major, "=elapsed       ~.6fs", [Time]),
     print(1, "*** FAILED ~ts ***",
 	  [get_info_str(Mod,Func, CaseNum, get(test_server_cases))]),
@@ -4190,7 +4190,7 @@ progress(failed, CaseNum, Mod, Func, GrName, Loc, Reason, T,
 			 true -> {Loc,Loc}
 		       end,
     Time = if is_number(T) -> float(T); true -> 0.0 end,
-    print(major, "=result        failed: ~tp, ~tp", [Reason,LocMaj]),
+    print(major, "=result        failed: ~tkp, ~tp", [Reason,LocMaj]),
     print(major, "=elapsed       ~.6fs", [Time]),
     print(1, "*** FAILED ~ts ***",
 	  [get_info_str(Mod,Func, CaseNum, get(test_server_cases))]),
@@ -4351,7 +4351,7 @@ to_string(Term) when is_list(Term) ->
 	String     -> lists:flatten(String)
     end;
 to_string(Term) ->
-    lists:flatten(io_lib:format("~tp", [Term])).
+    lists:flatten(io_lib:format("~tkp", [Term])).
 
 get_last_loc(Loc) when is_tuple(Loc) ->
     Loc;
@@ -4441,7 +4441,7 @@ format_exception(Error) ->
 do_format_exception(Reason={Error,Stack}) ->
     StackFun = fun(_, _, _) -> false end,
     PF = fun(Term, I) ->
-		 io_lib:format("~." ++ integer_to_list(I) ++ "tp", [Term])
+		 io_lib:format("~." ++ integer_to_list(I) ++ "tkp", [Term])
 	 end,
     case catch erl_error:format_exception(1, error, Error, Stack, StackFun, PF, utf8) of
 	{'EXIT',_R} ->
-- 
2.43.0

openSUSE Build Service is sponsored by