From b6f855d3f393a382dc9e0f853c639daa8424bbea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Tue, 11 Nov 2025 22:02:01 +0100 Subject: [PATCH] [scripts/generate_result] don't reorder "small" dicts/lists --- scripts/generate_test_result.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/scripts/generate_test_result.py b/scripts/generate_test_result.py index f2cc2054..92cffc1b 100755 --- a/scripts/generate_test_result.py +++ b/scripts/generate_test_result.py @@ -171,13 +171,21 @@ def sort_key(key, value): return 0 if isinstance(value, str) and "\n" in value: return 7000 - if isinstance(value, list) and len(value) > 1: + if isinstance(value, list) and not small(value): return 8000 - if isinstance(value, dict): + if isinstance(value, dict) and not small(value): return 9000 return 0 +def small(obj): + if isinstance(obj, list): + return False if len(obj) > 1 else small(obj[0]) + if isinstance(obj, dict): + return False if len(obj) > 1 else small(next(iter(obj.values()))) + return True + + def insert_test_result(args, result, lines): idx_block = None flag = False