Added test_check_for_ambiguous_filename_mentions_of_longer_paths

This commit is contained in:
Paul Gauthier 2023-05-27 08:39:18 -07:00
parent 08164034ff
commit 4fd1bf7f21
2 changed files with 22 additions and 5 deletions

View file

@ -352,8 +352,12 @@ class Coder:
fname_to_rel_fnames[fname].append(rel_fname)
for fname, rel_fnames in fname_to_rel_fnames.items():
if len(rel_fnames) == 1 and (fname in words or rel_fnames[0] in words):
if len(rel_fnames) == 1 and fname in words:
mentioned_rel_fnames.add(rel_fnames[0])
else:
for rel_fname in rel_fnames:
if rel_fname in words:
mentioned_rel_fnames.add(rel_fname)
if not mentioned_rel_fnames:
return