diff --git a/test/guix_studio_test/test_view/test_utils.py b/test/guix_studio_test/test_view/test_utils.py index 17e43fb0..ae1849e1 100644 --- a/test/guix_studio_test/test_view/test_utils.py +++ b/test/guix_studio_test/test_view/test_utils.py @@ -7,6 +7,7 @@ # https://opensource.org/licenses/MIT. # # SPDX-License-Identifier: MIT +# Some portions generated by Claude Code (Opus 5). import os import sys @@ -217,7 +218,11 @@ def compare_file(pathname_1, pathname_2, encoding = "", compare_start_string = " start_row_2 = 0 if compare_start_string != "": - # find the line where comparing starts + # Find the line where comparing starts, independently in each file. The + # two files may reach that line at different offsets -- a generated file + # carries the Studio banner, while the golden checked in beside it also + # carries a licence header -- so each start row must be looked up in its + # own list. for line in list_1: if compare_start_string in line: start_row_1 = list_1.index(line) @@ -225,7 +230,7 @@ def compare_file(pathname_1, pathname_2, encoding = "", compare_start_string = " for line in list_2: if compare_start_string in line: - start_row_2 = list_1.index(line) + start_row_2 = list_2.index(line) break; # compare from the start line