From 5d65c47b0388b3e3fa50b8ddfbda4f417af4735f Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Fri, 21 Aug 2026 03:24:10 +0100 Subject: When testing, canonicalize links before comparing them. --- tests/test_domagi.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/test_domagi.py b/tests/test_domagi.py index 3f63550..38c7c69 100644 --- a/tests/test_domagi.py +++ b/tests/test_domagi.py @@ -28,10 +28,19 @@ import pytest from domagi.domagi import main def assert_gfa_equal(expected, actual): + def invert_orientation(orientation): + return "-" if orientation=="+" else "+" + def process_gfa_line(line): fields = line.split("\t") if fields[0] == "L": - return fields[:5] + _, from_segment, from_orientation, to_segment, to_orientation = fields[:5] + if from_segment <= to_segment: + return ["L", from_segment, from_orientation, to_segment, to_orientation] + else: + return ["L", + to_segment, invert_orientation(to_orientation), + from_segment, invert_orientation(from_orientation)] elif fields[0] == "P": return fields[:3] else: -- cgit 1.4.1