upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/tests/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'tests/scripts')
-rw-r--r--tests/scripts/test_bitflash_tools.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/scripts/test_bitflash_tools.py b/tests/scripts/test_bitflash_tools.py
index 4b18d1e..3b4c846 100644
--- a/tests/scripts/test_bitflash_tools.py
+++ b/tests/scripts/test_bitflash_tools.py
@@ -159,8 +159,11 @@ def compare_golden(name, actual, update):
159 path.parent.mkdir(parents=True, exist_ok=True) 159 path.parent.mkdir(parents=True, exist_ok=True)
160 path.write_bytes(actual) 160 path.write_bytes(actual)
161 return 161 return
162 expected = path.read_bytes() 162 # The tools promise canonical LF-terminated JSON. On Windows checkouts a
163 if actual != expected: 163 # fixture may still appear as CRLF in the working tree; normalize only line
164 # endings so content, field order and compact serialization still drift-test.
165 expected = path.read_bytes().replace(b"\r\n", b"\n")
166 if actual.replace(b"\r\n", b"\n") != expected:
164 raise AssertionError("golden mismatch: %s" % name) 167 raise AssertionError("golden mismatch: %s" % name)
165 168
166 169