6 f
=glob
.iglob(sys
.argv
[1] + '/**/*.php.diff', recursive
=True)
9 name
= tmp
[:len(tmp
) - 5]
10 if os
.path
.isfile(name
+ '.expectf'):
15 with
open(l2
+ '.diff') as f
:
24 if re
.match('(\d+)\+.*', line
):
27 if re
.match('(\d+)\-.*', line
):
35 p1
= '(\d+)\+\s(.*line\s)(\d+)'
36 p2
= '(\d+)\-\s(.*line\s)(\d+)'
38 s2
= vecSub
[i
].replace('[^\r\n]', '[^\\r\\n]')
39 res1
= re
.match(p1
, s1
)
40 res2
= re
.match(p2
, s2
)
41 if res1
is None or res2
is None:
44 elif re
.match(res2
.group(2), res1
.group(2)) is None:
48 stringVec
.append(res2
.group(2).replace('[^\\r\\n]', '[^\r\n]'))
49 lineNumber
.append(res1
.group(3))
50 oldNumber
.append(res2
.group(3))
56 with
open(l2
+ '.expectf') as text
:
60 if re
.match(stringVec
[i
], l
) and used
[i
] is False:
61 tmp
= l
.replace('line ' + oldNumber
[i
], 'line ' + lineNumber
[i
])
66 f
= open(l2
+ '.expectf', 'w')