From 45158de351b24c604ab64a004131b965ea00eaf7 Mon Sep 17 00:00:00 2001 From: Viv Date: Thu, 25 Jan 2024 15:05:32 -0500 Subject: [PATCH] `parsers.py`: Add fix for inconsistent ordering between test runs --- src/tja2fumen/parsers.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/tja2fumen/parsers.py b/src/tja2fumen/parsers.py index ac80311..6270481 100644 --- a/src/tja2fumen/parsers.py +++ b/src/tja2fumen/parsers.py @@ -156,6 +156,12 @@ def split_tja_lines_into_courses(lines: List[str]) -> TJASong: if not v.data]: del parsed_tja.courses[course_name] + # Recreate dict with consistent insertion order + parsed_tja.courses = { + key: parsed_tja.courses[key] for key + in sorted(parsed_tja.courses.keys()) + } + return parsed_tja