You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While running the unit tests on a modified branch of Python Patch, I've been trying to debug some of the failed tests I'm seeing. The first of these, test_multiline_false_on_other_file() would appear to be working correctly with the master branch, and failing with my branch, however, by manually checking the test patch and target files, I believe that the wrong value is being checked for.
The test uses the method assertFalse() on the return value of can_patch(), which in turn calls _match_file_hunks(). The False value here is coming from _match_file_hunks() when checking hunk 1 of the patch 01uni_multi.patch aginst updatedlg.cpp.
Checking still deeper I found that when it fails, _match_file_hunks() is in fact making the following comparison, between line 97 of the target file and the fourth line of the patch hunk, rather than the fifth:
b''!=b' lst->InsertColumn(4, _("Rev"));'
As far as I can tell, a bug somewhere in patch.py is causing an addition line in the patch to be compared with the target file, and the unit test checking for this has been set up incorrectly, since the patch seems to be valid for the files it modifies.
Can anyone throw some light on to what exactly test_multiline_false_on_other_file() is intended to check? Am I correct in my deductions above, or have I overlooked something?
The text was updated successfully, but these errors were encountered:
While running the unit tests on a modified branch of Python Patch, I've been trying to debug some of the failed tests I'm seeing. The first of these,
test_multiline_false_on_other_file()
would appear to be working correctly with themaster
branch, and failing with my branch, however, by manually checking the test patch and target files, I believe that the wrong value is being checked for.The test uses the method
assertFalse()
on the return value ofcan_patch()
, which in turn calls_match_file_hunks()
. TheFalse
value here is coming from_match_file_hunks()
when checking hunk 1 of the patch01uni_multi.patch
aginstupdatedlg.cpp
.This is the hunk in question:
and here is the relevant section of
updatedlg.cpp
, starting from line 94:Checking still deeper I found that when it fails,
_match_file_hunks()
is in fact making the following comparison, between line 97 of the target file and the fourth line of the patch hunk, rather than the fifth:As far as I can tell, a bug somewhere in
patch.py
is causing an addition line in the patch to be compared with the target file, and the unit test checking for this has been set up incorrectly, since the patch seems to be valid for the files it modifies.Can anyone throw some light on to what exactly
test_multiline_false_on_other_file()
is intended to check? Am I correct in my deductions above, or have I overlooked something?The text was updated successfully, but these errors were encountered: