Skip to content

Commit 861f518

Browse files
committed
Windows hotfix for linemarks test
1 parent 9032bb4 commit 861f518

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

test/tests.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1527,17 +1527,18 @@ def dml_lines_iter(self, c_file, c_lines_iter):
15271527
if m is not None:
15281528
(lineno, filename) = m.groups()
15291529
lineno = int(lineno)
1530-
if (Path(self.scratchdir) / filename == c_file):
1530+
redir_file = Path(self.scratchdir) / filename
1531+
if redir_file.samefile(c_file):
15311532
assert not reset, \
1532-
f"Redundant line directive reset at {c_lineno}"
1533+
f'Redundant line directive reset at {c_lineno}'
15331534
assert lineno == c_lineno + 1, \
1534-
f"Incorrect line directive reset at {c_lineno}"
1535+
f'Incorrect line directive reset at {c_lineno}'
15351536
reset = True
15361537
dml_lineno = None
1537-
elif filename.endswith(self.filename):
1538+
elif redir_file.samefile(self.filename):
15381539
assert dml_lineno != lineno, \
1539-
(f'Redundant linemark for {dml_lineno} at '
1540-
+ f'{c_lineno}')
1540+
(f'Redundant linemark for {dml_lineno} at '
1541+
+ f'{c_lineno}')
15411542
reset = False
15421543
dml_lineno = lineno - 1
15431544
else:
@@ -1549,7 +1550,7 @@ def dml_lines_iter(self, c_file, c_lines_iter):
15491550
assert curr_func is None
15501551
curr_func = m.group(1)
15511552
assert reset, \
1552-
f'Line directive not reset by start of {curr_func}'
1553+
f'Line directive not reset by start of {curr_func}'
15531554
continue
15541555
if dml_lineno is not None:
15551556
yield (dml_lineno, c_lineno, curr_func)

0 commit comments

Comments
 (0)