mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-22 13:26:10 +01:00
Approvals normalize paths with both backward and forward slash
This commit is contained in:
parent
9200b4078b
commit
c4df47c246
@ -99,9 +99,15 @@ def diffFiles(fileA, fileB):
|
|||||||
|
|
||||||
|
|
||||||
def normalizeFilepath(line):
|
def normalizeFilepath(line):
|
||||||
if catchPath in line:
|
# Sometimes the path separators used by compiler and Python can differ,
|
||||||
# make paths relative to Catch root
|
# so we try to match the path with both forward and backward path
|
||||||
line = line.replace(catchPath + os.sep, '')
|
# separators, to make the paths relative to Catch2 repo root.
|
||||||
|
forwardSlashPath = catchPath.replace('\\', '/')
|
||||||
|
if forwardSlashPath in line:
|
||||||
|
line = line.replace(forwardSlashPath + '/', '')
|
||||||
|
backwardSlashPath = catchPath.replace('/', '\\')
|
||||||
|
if backwardSlashPath in line:
|
||||||
|
line = line.replace(backwardSlashPath + '\\', '')
|
||||||
|
|
||||||
m = langFilenameParser.match(line)
|
m = langFilenameParser.match(line)
|
||||||
if m:
|
if m:
|
||||||
|
Loading…
Reference in New Issue
Block a user