Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions test/guix_studio_test/test_view/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -217,15 +218,19 @@ 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)
break;

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
Expand Down
Loading