[scripts/generate_result] don't reorder "small" dicts/lists

This commit is contained in:
Mike Fährmann
2025-11-11 22:02:01 +01:00
parent 76081b312e
commit b6f855d3f3

View File

@@ -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